Skip to content

Instantly share code, notes, and snippets.

@n0r8-ecomarkup
Created October 21, 2014 13:19
Show Gist options
  • Save n0r8-ecomarkup/bb5fc1def3ad592ab1c2 to your computer and use it in GitHub Desktop.
Save n0r8-ecomarkup/bb5fc1def3ad592ab1c2 to your computer and use it in GitHub Desktop.
Fancybox custom shwo and hide effect
$.fancybox.transitions.myZoomIn = function () {
$.fancybox.wrap.addClass('animate');
setTimeout(function () {
$.fancybox._afterZoomIn();
}, $.fancybox.current.openSpeed);
//or transition end event
};
$.fancybox.transitions.myZoomOut = function () {
$.fancybox.wrap.addClass('animateOut');
setTimeout(function () {
$.fancybox.wrap.hide();
$.fancybox._afterZoomOut();
}, $.fancybox.current.openSpeed);
//or transition end event
};
$('.btn-popup').fancybox({
padding: 0,
openMethod:'myZoomIn',
closeMethod:'myZoomOut',
openSpeed: 1000,
closeClick:true,
wrapCSS: 'fancybox-animation-parameters'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment