This plugin enables a variety of CSS3 open/close transitions for fancybox 2.
Transitions have been taken from the excellent "Nifty Modal Window Effects" by Tympanus.
Download jQuery
Download fancybox 2
Download and include jquery.fancybox-transitions.js
and jquery.fancybox-transitions.css
.
Make sure to include everything in the correct order:
<!-- Add jQuery --> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <!-- Add fancyBox --> <link rel="stylesheet" href="/css/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" /> <script type="text/javascript" src="/js/jquery.fancybox.pack.js?v=2.1.5"></script> <!--Add Fancybox transitions --> <link rel="stylesheet" href="/css/jquery.fancybox-transitions.css?v=0.1" type="text/css" media="screen" /> <script src="/js/jquery.fancybox-transitions.js?v=0.1"></script>
Then, simply pass any of the new transitions into the fancybox initialization as an openMethod
and/or closeMethod
$('.fancybox').fancybox({ openMethod: 'superscaleIn', closeMethod: 'superscaleOut' });
- Drop in (
'drop'
) - Fade in and scale up (
'fadescale'
) - Slide in from the right (
'slideright'
) - Slide in from the bottom (
'slidebottom'
) - Newspaper (twirl in) (
'newspaper'
) - Fall (
'fall'
) - Fall from the side (
'fallside'
) - Slide from the top (
'stickyup'
) - Horizontal 3D flip (
'horizontalflip'
) - Vertical 3D flip (
'verticalflip'
) - 3D swinging sign (
'sign'
) - Super scaled! (
'superscaled'
) - 3D growing slit (
'slit'
) - 3D rotate from bottom (
'rotatebottom'
) - 3D rotate from left (
'rotateleft'
) - Blur (
'blur'
)