有没有让ColorBox(jquery弹出脚本)实际上自动“弹出”,如果是这样,我为什么编辑? 我需要它在主页上大约3秒钟后弹出。 谢谢!
答案 0 :(得分:2)
将打开参数设置为true。 (默认为false);如果想要延迟,你会写一些间隔的javascript。
答案 1 :(得分:1)
您可以将open属性设置为 true 。
<script type="text/javascript">
$(document).ready(function() {
//For url
$.fn.colorbox({href:"example.html", open:true});
//For link
$("a.example").colorbox({open:true});
//For delay
setTimeout("$.fn.colorbox({href:'example.html', width:500, height: 300,
open:true});", 3000);
//For inline
$.fn.colorbox({inline:true, width: 660, height: 405, href:"#example"});
});
</script>
以下是文档:jacklmoore.com/colorbox