Advertisement
Guest User

Fancybox demo

a guest
Mar 8th, 2013
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.70 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>fancyBox - Fancy jQuery Lightbox Alternative | Demonstration</title>
  5.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6.  
  7.     <!-- Add jQuery library -->
  8.     <script type="text/javascript" src="../lib/jquery-1.9.0.min.js"></script>
  9.  
  10.     <!-- Add mousewheel plugin (this is optional) -->
  11.     <script type="text/javascript" src="../lib/jquery.mousewheel-3.0.6.pack.js"></script>
  12.  
  13.     <!-- Add fancyBox main JS and CSS files -->
  14.     <script type="text/javascript" src="../source/jquery.fancybox.js?v=2.1.4"></script>
  15.     <link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css?v=2.1.4" media="screen" />
  16.  
  17.     <!-- Add Button helper (this is optional) -->
  18.     <link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-buttons.css?v=1.0.5" />
  19.     <script type="text/javascript" src="../source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
  20.  
  21.     <!-- Add Thumbnail helper (this is optional) -->
  22.     <link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" />
  23.     <script type="text/javascript" src="../source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
  24.  
  25.     <!-- Add Media helper (this is optional) -->
  26.     <script type="text/javascript" src="../source/helpers/jquery.fancybox-media.js?v=1.0.5"></script>
  27.  
  28.     <script type="text/javascript">
  29.         $(document).ready(function() {
  30.             /*
  31.              *  Simple image gallery. Uses default settings
  32.              */
  33.  
  34.             $('.fancybox').fancybox();
  35.  
  36.             /*
  37.              *  Different effects
  38.              */
  39.  
  40.             // Change title type, overlay closing speed
  41.             $(".fancybox-effects-a").fancybox({
  42.                 helpers: {
  43.                     title : {
  44.                         type : 'outside'
  45.                     },
  46.                     overlay : {
  47.                         speedOut : 0
  48.                     }
  49.                 }
  50.             });
  51.  
  52.             // Disable opening and closing animations, change title type
  53.             $(".fancybox-effects-b").fancybox({
  54.                 openEffect  : 'none',
  55.                 closeEffect : 'none',
  56.  
  57.                 helpers : {
  58.                     title : {
  59.                         type : 'over'
  60.                     }
  61.                 }
  62.             });
  63.  
  64.             // Set custom style, close if clicked, change title type and overlay color
  65.             $(".fancybox-effects-c").fancybox({
  66.                 wrapCSS    : 'fancybox-custom',
  67.                 closeClick : true,
  68.  
  69.                 openEffect : 'none',
  70.  
  71.                 helpers : {
  72.                     title : {
  73.                         type : 'inside'
  74.                     },
  75.                     overlay : {
  76.                         css : {
  77.                             'background' : 'rgba(238,238,238,0.85)'
  78.                         }
  79.                     }
  80.                 }
  81.             });
  82.  
  83.             // Remove padding, set opening and closing animations, close if clicked and disable overlay
  84.             $(".fancybox-effects-d").fancybox({
  85.                 padding: 0,
  86.  
  87.                 openEffect : 'elastic',
  88.                 openSpeed  : 150,
  89.  
  90.                 closeEffect : 'elastic',
  91.                 closeSpeed  : 150,
  92.  
  93.                 closeClick : true,
  94.  
  95.                 helpers : {
  96.                     overlay : null
  97.                 }
  98.             });
  99.  
  100.             /*
  101.              *  Button helper. Disable animations, hide close button, change title type and content
  102.              */
  103.  
  104.             $('.fancybox-buttons').fancybox({
  105.                 openEffect  : 'none',
  106.                 closeEffect : 'none',
  107.  
  108.                 prevEffect : 'none',
  109.                 nextEffect : 'none',
  110.  
  111.                 closeBtn  : false,
  112.  
  113.                 helpers : {
  114.                     title : {
  115.                         type : 'inside'
  116.                     },
  117.                     buttons : {}
  118.                 },
  119.  
  120.                 afterLoad : function() {
  121.                     this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
  122.                 }
  123.             });
  124.  
  125.  
  126.             /*
  127.              *  Thumbnail helper. Disable animations, hide close button, arrows and slide to next gallery item if clicked
  128.              */
  129.  
  130.             $('.fancybox-thumbs').fancybox({
  131.                 prevEffect : 'none',
  132.                 nextEffect : 'none',
  133.  
  134.                 closeBtn  : false,
  135.                 arrows    : false,
  136.                 nextClick : true,
  137.  
  138.                 helpers : {
  139.                     thumbs : {
  140.                         width  : 50,
  141.                         height : 50
  142.                     }
  143.                 }
  144.             });
  145.  
  146.             /*
  147.              *  Media helper. Group items, disable animations, hide arrows, enable media and button helpers.
  148.             */
  149.             $('.fancybox-media')
  150.                 .attr('rel', 'media-gallery')
  151.                 .fancybox({
  152.                     openEffect : 'none',
  153.                     closeEffect : 'none',
  154.                     prevEffect : 'none',
  155.                     nextEffect : 'none',
  156.  
  157.                     arrows : false,
  158.                     helpers : {
  159.                         media : {},
  160.                         buttons : {}
  161.                     }
  162.                 });
  163.  
  164.             /*
  165.              *  Open manually
  166.              */
  167.  
  168.             $("#fancybox-manual-a").click(function() {
  169.                 $.fancybox.open('1_b.jpg');
  170.             });
  171.  
  172.             $("#fancybox-manual-b").click(function() {
  173.                 $.fancybox.open({
  174.                     href : 'iframe.html',
  175.                     type : 'iframe',
  176.                     padding : 5
  177.                 });
  178.             });
  179.  
  180.             $("#fancybox-manual-c").click(function() {
  181.                 $.fancybox.open([
  182.                     {
  183.                         href : '1_b.jpg',
  184.                         title : 'My title'
  185.                     }, {
  186.                         href : '2_b.jpg',
  187.                         title : '2nd title'
  188.                     }, {
  189.                         href : '3_b.jpg'
  190.                     }
  191.                 ], {
  192.                     helpers : {
  193.                         thumbs : {
  194.                             width: 75,
  195.                             height: 50
  196.                         }
  197.                     }
  198.                 });
  199.             });
  200.  
  201.  
  202.         });
  203.     </script>
  204.     <style type="text/css">
  205.         .fancybox-custom .fancybox-skin {
  206.             box-shadow: 0 0 50px #222;
  207.         }
  208.     </style>
  209. </head>
  210. <body>
  211.     <h1>fancyBox</h1>
  212.  
  213.     <p>This is a demonstration. More information and examples: <a href="http://fancyapps.com/fancybox/">www.fancyapps.com/fancybox/</a></p>
  214.  
  215.     <h3>Simple image gallery</h3>
  216.     <p>
  217.         <a class="fancybox" href="1_b.jpg" data-fancybox-group="gallery" title="Lorem ipsum dolor sit amet"><img src="1_s.jpg" alt="" /></a>
  218.  
  219.         <a class="fancybox" href="2_b.jpg" data-fancybox-group="gallery" title="Etiam quis mi eu elit temp"><img src="2_s.jpg" alt="" /></a>
  220.  
  221.         <a class="fancybox" href="3_b.jpg" data-fancybox-group="gallery" title="Cras neque mi, semper leon"><img src="3_s.jpg" alt="" /></a>
  222.  
  223.         <a class="fancybox" href="4_b.jpg" data-fancybox-group="gallery" title="Sed vel sapien vel sem uno"><img src="4_s.jpg" alt="" /></a>
  224.     </p>
  225.  
  226.     <h3>Different effects</h3>
  227.     <p>
  228.         <a class="fancybox-effects-a" href="5_b.jpg" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"><img src="5_s.jpg" alt="" /></a>
  229.  
  230.         <a class="fancybox-effects-b" href="5_b.jpg" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"><img src="5_s.jpg" alt="" /></a>
  231.  
  232.         <a class="fancybox-effects-c" href="5_b.jpg" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"><img src="5_s.jpg" alt="" /></a>
  233.  
  234.         <a class="fancybox-effects-d" href="5_b.jpg" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"><img src="5_s.jpg" alt="" /></a>
  235.     </p>
  236.  
  237.     <h3>Various types</h3>
  238.     <p>
  239.         fancyBox will try to guess content type from href attribute but you can specify it directly by adding classname (fancybox.image, fancybox.iframe, etc).
  240.     </p>
  241.     <ul>
  242.         <li><a class="fancybox" href="#inline1" title="Lorem ipsum dolor sit amet">Inline</a></li>
  243.         <li><a class="fancybox fancybox.ajax" href="ajax.txt">Ajax</a></li>
  244.         <li><a class="fancybox fancybox.iframe" href="iframe.html">Iframe</a></li>
  245.         <li><a class="fancybox" href="http://www.adobe.com/jp/events/cs3_web_edition_tour/swfs/perform.swf">Swf</a></li>
  246.     </ul>
  247.  
  248.     <div id="inline1" style="width:400px;display: none;">
  249.         <h3>Etiam quis mi eu elit</h3>
  250.         <p>
  251.             Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis mi eu elit tempor facilisis id et neque. Nulla sit amet sem sapien. Vestibulum imperdiet porta ante ac ornare. Nulla et lorem eu nibh adipiscing ultricies nec at lacus. Cras laoreet ultricies sem, at blandit mi eleifend aliquam. Nunc enim ipsum, vehicula non pretium varius, cursus ac tortor. Vivamus fringilla congue laoreet. Quisque ultrices sodales orci, quis rhoncus justo auctor in. Phasellus dui eros, bibendum eu feugiat ornare, faucibus eu mi. Nunc aliquet tempus sem, id aliquam diam varius ac. Maecenas nisl nunc, molestie vitae eleifend vel, iaculis sed magna. Aenean tempus lacus vitae orci posuere porttitor eget non felis. Donec lectus elit, aliquam nec eleifend sit amet, vestibulum sed nunc.
  252.         </p>
  253.     </div>
  254.  
  255.     <p>
  256.         Ajax example will not run from your local computer and requires a server to run.
  257.     </p>
  258.  
  259.     <h3>Button helper</h3>
  260.     <p>
  261.         <a class="fancybox-buttons" data-fancybox-group="button" href="1_b.jpg"><img src="1_s.jpg" alt="" /></a>
  262.  
  263.         <a class="fancybox-buttons" data-fancybox-group="button" href="2_b.jpg"><img src="2_s.jpg" alt="" /></a>
  264.  
  265.         <a class="fancybox-buttons" data-fancybox-group="button" href="3_b.jpg"><img src="3_s.jpg" alt="" /></a>
  266.  
  267.         <a class="fancybox-buttons" data-fancybox-group="button" href="4_b.jpg"><img src="4_s.jpg" alt="" /></a>
  268.     </p>
  269.  
  270.     <h3>Thumbnail helper</h3>
  271.     <p>
  272.         <a class="fancybox-thumbs" data-fancybox-group="thumb" href="4_b.jpg"><img src="4_s.jpg" alt="" /></a>
  273.  
  274.         <a class="fancybox-thumbs" data-fancybox-group="thumb" href="3_b.jpg"><img src="3_s.jpg" alt="" /></a>
  275.  
  276.         <a class="fancybox-thumbs" data-fancybox-group="thumb" href="2_b.jpg"><img src="2_s.jpg" alt="" /></a>
  277.  
  278.         <a class="fancybox-thumbs" data-fancybox-group="thumb" href="1_b.jpg"><img src="1_s.jpg" alt="" /></a>
  279.     </p>
  280.  
  281.     <h3>Media helper</h3>
  282.     <p>
  283.         Will not run from your local computer, requires a server to run.
  284.     </p>
  285.  
  286.     <ul>
  287.         <li><a class="fancybox-media" href="http://www.youtube.com/watch?v=opj24KnzrWo">Youtube</a></li>
  288.         <li><a class="fancybox-media" href="http://vimeo.com/25634903">Vimeo</a></li>
  289.         <li><a class="fancybox-media" href="http://www.metacafe.com/watch/7635964/">Metacafe</a></li>
  290.         <li><a class="fancybox-media" href="http://www.dailymotion.com/video/xoeylt_electric-guest-this-head-i-hold_music">Dailymotion</a></li>
  291.         <li><a class="fancybox-media" href="http://twitvid.com/QY7MD">Twitvid</a></li>
  292.         <li><a class="fancybox-media" href="http://twitpic.com/7p93st">Twitpic</a></li>
  293.         <li><a class="fancybox-media" href="http://instagr.am/p/IejkuUGxQn">Instagram</a></li>
  294.     </ul>
  295.  
  296.     <h3>Open manually</h3>
  297.     <ul>
  298.         <li><a id="fancybox-manual-a" href="javascript:;">Open single item</a></li>
  299.         <li><a id="fancybox-manual-b" href="javascript:;">Open single item, custom options</a></li>
  300.         <li><a id="fancybox-manual-c" href="javascript:;">Open gallery</a></li>
  301.     </ul>
  302.  
  303.     <p>
  304.         Photo Credit: Instagrammer @whitjohns
  305.     </p>
  306. </body>
  307. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement