如何确定fancybox何时打开? [英] How to determine when fancybox is open?

查看:63
本文介绍了如何确定fancybox何时打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道fancybox已被打开以允许或拒绝其他功能启动.

I need to know that fancybox has been open up that to allow or deny another function to start.

内置功能Fancybox(如"onStart"或"onClosed")不起作用.

Build-in functions Fancybox like 'onStart' or 'onClosed' not work.

我说的是1.3.0 RC2版本

I'm talking about version 1.3.0 RC2

推荐答案

您使用的版本显然与文档不匹配;我查看了源代码,发现选项的名称与在线文档不同.我刚刚使用1.3RC2测试了以下内容:

The version your using apparently doesn't match the documentation; I looked at the source and saw the names of the options were different the the online docs. I just tested the following with 1.3RC2:

$(document).ready(function() {

    function myStartFunction() { alert('fancy box opened'); }

    $("a#inline").fancybox({
        'onStart': myStartFunction
    });  
});

您要查找的选项是"onStart"-每次打开包装盒时,myStartFunction中的警报都会关闭.我不确定他们何时更改了该选项,但是您可以在底部查看所使用的任何版本的来源,并查看该选项的名称.

The option you're looking for is 'onStart' - the alert in myStartFunction goes off every time I open a box. I'm not sure when they changed the option but you can look at the source of any version you use at the bottom, and see what the option should be called.

编辑

我刚刚仔细检查了v1.2.5(我使用的版本),并且回调的名称确实不同. callbackOnStart适用于1.25,但正如我所说,不适用于1.3

I just double checked on v1.2.5 - the version I use - and the callbacks are indeed named different. callbackOnStart works with 1.25 but, as I said, not 1.3

这篇关于如何确定fancybox何时打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆