Add custom transitions -
(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));
Use them like -
$(".fancybox").fancybox({
openMethod : 'dropIn',
openSpeed : 250,
closeMethod : 'dropOut',
closeSpeed : 100
});
And whoa-la - the same effect!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…