Fancybox,自定义开放转换

Fru*_*uit 1 jquery modal-dialog fancybox

有谁知道如何使用自定义开放转换打开fancyBox:

http://fancyapps.com/fancybox/

我希望实现类似的转换到这里找到的示例:

http://www.zurb.com/playground/reveal-modal-plugin

我喜欢显示插件,但它没有我需要fancyBox为新项目做的一些功能

非常感谢,

山姆

Jan*_*nis 9

添加自定义过渡 -

(function ($, F) {
    F.transitions.dropIn = function() {
        var endPos = F._getPosition(true);

        endPos.top = (parseInt(endPos.top, 10) - 200) + 'px';

        F.wrap.css(endPos).show().animate({
            top: '+=200px'
        }, {
            duration: F.current.openSpeed,
            complete: F._afterZoomIn
        });
    };

    F.transitions.dropOut = function() {
        F.wrap.removeClass('fancybox-opened').animate({
            top: '-=200px'
        }, {
            duration: F.current.closeSpeed,
            complete: F._afterZoomOut
        });
    };

}(jQuery, jQuery.fancybox));
Run Code Online (Sandbox Code Playgroud)

使用它们像 -

$(".fancybox").fancybox({
    openMethod : 'dropIn',
    openSpeed : 250,

    closeMethod : 'dropOut',
    closeSpeed : 100
});
Run Code Online (Sandbox Code Playgroud)

而且 - 哇 - 同样的效果!