1
有沒有辦法使ColorBox(jquery彈出腳本)實際上自動彈出,如果是,我編輯了哪部分? 我需要它在主頁上大約3秒後彈出。 謝謝!ColorBox - 自動彈出(如何?)
有沒有辦法使ColorBox(jquery彈出腳本)實際上自動彈出,如果是,我編輯了哪部分? 我需要它在主頁上大約3秒後彈出。 謝謝!ColorBox - 自動彈出(如何?)
將打開參數設置爲true。 (它默認爲false);如果想要延遲,你需要間隔一段時間寫javascript。
您可以將打開的屬性設置爲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