jQuery 在页面加载时打开 Colorbox
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5969741/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Open Colorbox on page load
提问by Franklin
I have been trying to make the colorbox work on page load, but I can see only the loading with a plain background. I used this code
我一直试图让颜色框在页面加载时工作,但我只能看到带有纯背景的加载。我用了这个代码
$.fn.colorbox({id:'', title:'',open:true});
$.fn.colorbox({id:'', title:'',open:true});
You can find the demo here
你可以在这里找到演示
http://www.bloggermint.com/demos/popupsub/colorbox/example5/index.html
http://www.bloggermint.com/demos/popupsub/colorbox/example5/index.html
回答by kei
EDITED:
编辑:
<script type="text/javascript">
$(document).ready(function(){
$.colorbox({width:"30%", inline:true, href:"#subscribe"});
});
</script>