Ste*_*eve 3 jquery callback colorbox
当单击类“iframe”的链接时,我有一个打开 iframe 颜色框的现有调用:
$(".iframe").colorbox({iframe:true, width:"200px", height:"500px"});
我想向这个颜色框添加一个回调以在它即将打开时触发一个函数:
onOpen:function(){ alert('colorbox is about to open'); }
但是这段代码去哪里了?我尝试将其添加到 colorbox() 中,但随后整个过程都失败了。我有点困惑。
它作为一个选项如下:
$(".iframe").colorbox({iframe:true, width:"200px", height:"500px",onOpen:function(){ alert('colorbox is about to open'); }});
Run Code Online (Sandbox Code Playgroud)
或者
$(".iframe").colorbox({iframe:true, width:"200px", height:"500px",onOpen:openCallBack});
function openCallBack(){
//do something here
}
Run Code Online (Sandbox Code Playgroud)
而这里是工作的例子。
| 归档时间: |
|
| 查看次数: |
5199 次 |
| 最近记录: |