{"id":31556,"date":"2014-01-21T07:15:20","date_gmt":"2014-01-21T12:15:20","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=31556"},"modified":"2014-01-21T07:15:20","modified_gmt":"2014-01-21T12:15:20","slug":"js-animated-how-to-implement-jquery-fancybox-lightbox-plugin","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/js-animated-how-to-implement-jquery-fancybox-lightbox-plugin.html","title":{"rendered":"JS Animated. How to implement jQuery &#8220;FancyBox&#8221; lightbox plugin"},"content":{"rendered":"<p>This  tutorial is going to show you how to implement the jQuery &quot;FancyBox&quot;  lightbox plugin into your JS Animated template.<\/p>\r\n\r\n<a href=\"http:\/\/www.youtube.com\/watch?v=1pqJQ923T0Q?width=1280&amp;height=720\" rel=\"prettyPhoto\">JS Animated. How to implement jQuery &#8220;FancyBox&#8221; lightbox plugin<\/a>\r\n\r\n<p class=\"info-box\">FancyBox is  a tool for displaying images, html content and multi-media in a Mac-style  &quot;lightbox&quot; that floats over a web page and is built using the <a href=\"http:\/\/jquery.com\/\" rel=\"nofollow\" target=\"_blank\">jQuery  library<\/a>.<\/p> \r\n<p>To add it  to your page:<\/p>\r\n<ol>\r\n  <li><p>Download the plugin library from <a href=\"http:\/\/fancybox.net\/\" rel=\"nofollow\" target=\"_blank\">http:\/\/fancybox.net\/<\/a> on your computer and unpack  it.<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_1-300x199.jpg\" alt=\"js_animated_jquery_fancybox_lightbox_plugin_implementing_1\" width=\"300\" height=\"199\" class=\"alignnone size-medium wp-image-31557\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_1-300x199.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_1-150x99.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_1.jpg 944w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\r\n<\/li>\r\n  <li><p>Copy the <strong>fancybox<\/strong> folder from the unzipped package and paste it into the <strong>site<\/strong> folder of your template package.<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_2-300x157.jpg\" alt=\"js_animated_jquery_fancybox_lightbox_plugin_implementing_2\" width=\"300\" height=\"157\" class=\"alignnone size-medium wp-image-31558\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_2-300x157.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_2-150x78.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_2.jpg 819w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\r\n<\/li>\r\n  <li><p>Open the <strong>.html<\/strong> file with the  image you want to apply the plugin to\u00a0and add the libraries and the table of styles to it in Dreamweaver to  the <strong>&lt;head&gt;<\/strong> tag:<\/p>\r\n\r\n<pre class=\"brush:html\">\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;.\/fancybox\/jquery.fancybox-1.3.4.pack.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;.\/fancybox\/jquery.easing-1.4.pack.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;.\/fancybox\/jquery.mousewheel-3.0.4.pack.js&quot;&gt;&lt;\/script&gt;\r\n&lt;link rel=&quot;stylesheet&quot; href=&quot;.\/fancybox\/jquery.fancybox-1.3.4.css&quot; type=&quot;text\/css&quot; media=&quot;screen&quot; \/&gt;\r\n<\/pre>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_3.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_3-300x137.jpg\" alt=\"js_animated_jquery_fancybox_lightbox_plugin_implementing_3\" width=\"300\" height=\"137\" class=\"alignnone size-medium wp-image-31559\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_3-300x137.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_3-150x68.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_3.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n\r\n<li><p>Find the line with the image, e.g.<\/p><\/li>\r\n\r\n<pre class=\"brush:html\">\r\n&lt;img src=&quot;images\/image_small.jpg&quot; alt=&quot;&quot; \/&gt;\r\n<\/pre>\r\n\r\n<li><p>And change it to<\/p><\/li>\r\n\r\n<pre class=\"brush:html\">\r\n&lt;a class=&quot;fancybox&quot; href=&quot;images\/image_big.jpg&quot;&gt;&lt;img src=&quot;images\/image_small.jpg&quot; alt=&quot;&quot;\/&gt;&lt;\/a&gt;\r\n<\/pre>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_4.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_4-300x162.jpg\" alt=\"js_animated_jquery_fancybox_lightbox_plugin_implementing_4\" width=\"300\" height=\"162\" class=\"alignnone size-medium wp-image-31561\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_4-300x162.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_4-150x81.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_4.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\r\n  <li><p>In the images folder, there should be  image_big.jpg and image_small.jpg accordingly.<\/p><\/li>\r\n   \r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_5.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_5-300x161.jpg\" alt=\"js_animated_jquery_fancybox_lightbox_plugin_implementing_5\" width=\"300\" height=\"161\" class=\"alignnone size-medium wp-image-31562\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_5-300x161.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_5-150x80.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_5.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n   \r\n  <li><p>Initialize the gallery: add the  following to your <strong>.html<\/strong> file right before the closing <strong>&lt;\/head&gt;<\/strong> tag:<\/p>\r\n  \r\n<pre class=\"brush:js\">\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\n    $(document).ready(function() {\r\n   \t\t$(&quot;a.fancybox&quot;).fancybox();\r\n    });\r\n&lt;\/script&gt;\r\n<\/pre>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_6.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_6-300x162.jpg\" alt=\"js_animated_jquery_fancybox_lightbox_plugin_implementing_6\" width=\"300\" height=\"162\" class=\"alignnone size-medium wp-image-31563\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_6-300x162.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_6-150x81.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_6.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\r\n<\/li>\r\n  <li><p>Save the changes and\u00a0check your page in a web browser: the image should be opening in a lightbox.<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_7.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_7-300x151.jpg\" alt=\"js_animated_jquery_fancybox_lightbox_plugin_implementing_7\" width=\"300\" height=\"151\" class=\"alignnone size-medium wp-image-31564\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_7-300x151.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_7-150x75.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_fancybox_lightbox_plugin_implementing_7.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\r\n<\/li>\r\n<\/ol>\r\n\r\n<p>Using the  table of available options from <a href=\"http:\/\/fancybox.net\/api\" rel=\"nofollow\" target=\"_blank\">http:\/\/fancybox.net\/api<\/a>, you can pass them as key\/value  object to the fancybox() function. <\/p>\r\nFor more  information on how to use the plugin, please refer to the official manual at <a href=\"http:\/\/fancybox.net\/howto\" rel=\"nofollow\" target=\"_blank\">http:\/\/fancybox.net\/howto<\/a>.\r\n<\/p>\r\n\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n\r\n<a href=\"http:\/\/www.youtube.com\/watch?v=1pqJQ923T0Q?width=1280&amp;height=720\" rel=\"prettyPhoto\">JS Animated. How to implement jQuery &#8220;FancyBox&#8221; lightbox plugin<\/a>","protected":false},"excerpt":{"rendered":"<p>This  tutorial is going to show you how to implement the jQuery &quot;FancyBox&quot;  lightbox plugin into your JS Animated template.<\/p>\n","protected":false},"author":30,"featured_media":31568,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1016,253,270],"tags":[828,1574,827,768],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/31556"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=31556"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/31556\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/31568"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=31556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=31556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=31556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}