在页面加载时自动打开jQuery ColorBox

我已经将colorbox jQuery灯箱用于我的灯箱。 但在那个人应该点击按钮。 我想要在加载窗口时自动弹出窗口。

我的灯箱代码是

   $(document).ready(function(){ $(".ajax").colorbox(); });    

Other Content Types

Outside HTML (Ajax)

现在我想在加载窗口时自动弹出窗口。

使用最新版本的ColorBox ,您可以使用$.colorbox({inline:true, href:".ajax"});

工作演示: http : //jsfiddle.net/34v22/

我还清理了一下你的代码:

   My Automatic ColorBox       

Other Content Types

它工作,但我无法点击iframe页面。 我在iframe中放了一个表单。

     

如果您愿意,可以直接在jQuery调用中添加html

 (function($){ $(document).ready(function() { $.colorbox({innerWidth:420,innerHeight:315,html:''}); }); })(jQuery);