{"id":31507,"date":"2014-01-21T08:38:19","date_gmt":"2014-01-21T13:38:19","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=31507"},"modified":"2014-01-21T08:38:19","modified_gmt":"2014-01-21T13:38:19","slug":"js-animated-how-to-implement-jquery-magnific-popup-lightbox-plugin","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/js-animated-how-to-implement-jquery-magnific-popup-lightbox-plugin.html","title":{"rendered":"JS Animated. How to implement jQuery &#8220;Magnific Popup&#8221; lightbox plugin"},"content":{"rendered":"<p>This tutorial is going to show you how to implement the jQuery Magnific Popup  lightbox plugin into your JS Animated template.<\/p>\r\n\r\n<a href=\"http:\/\/www.youtube.com\/watch?v=p9FLFSed4cs?width=1280&amp;height=720\" rel=\"prettyPhoto\">JS Animated. How to implement jQuery &#8220;Magnific Popup&#8221; lightbox plugin<\/a>\r\n\r\n  <p class=\"info-box\">Magnific Popup<\/strong> is a fast,  light, mobile-friendly and responsive lightbox and modal dialog plugin built  using the <a href=\"http:\/\/jquery.com\/\" rel=\"nofollow\">jQuery library<\/a>. To see it in action, you can <a href=\"http:\/\/codepen.io\/collection\/nLcqo\" rel=\"nofollow\">play with examples on CodePen<\/a>. To add it to your page:<\/p>\r\n<ol>\r\n  <li><p>Download <strong>Magnific-Popup-master.zip<\/strong> from <a href=\"https:\/\/github.com\/dimsemenov\/Magnific-Popup\" target=\"_blank\" rel=\"nofollow\">https:\/\/github.com\/dimsemenov\/Magnific-Popup<\/a>\u00a0 on your computer and unpack it.<\/p> \r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_1-300x159.jpg\" alt=\"js_animated_jquery_magnific_popup_lightbox_plugin_implementing_1\" width=\"300\" height=\"159\" class=\"alignnone size-medium wp-image-31508\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_1-300x159.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_1-150x79.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_1.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\r\n<\/li>\r\n  <li><p>Copy the <strong>dist <\/strong>folder from the unzipped package and paste 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_magnific_popup_lightbox_plugin_implementing_2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_2-300x164.jpg\" alt=\"js_animated_jquery_magnific_popup_lightbox_plugin_implementing_2\" width=\"300\" height=\"164\" class=\"alignnone size-medium wp-image-31509\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_2-300x164.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_2-150x82.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_2.jpg 801w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\r\n<\/li>\r\n  <li>Open the <strong>.html<\/strong> file with the  image you want to apply the plugin to and add the libraries and the table of styles to it in DreamWeaver inside of the <strong>&lt;head&gt; <\/strong>tag:\r\n\r\n<pre class=\"brush:html\">\r\n&lt;!-- Magnific Popup core CSS file --&gt;\r\n  &lt;link rel=&quot;stylesheet&quot; href=&quot;.\/dist\/magnific-popup.css&quot;&gt;\r\n\r\n&lt;!-- Magnific Popup core CSS file --&gt; \r\n  &lt;link rel=&quot;stylesheet&quot; href=&quot;.\/dist\/magnific-popup.css&quot;&gt; \r\n\r\n&lt;!-- Magnific Popup core JS file --&gt; \r\n  &lt;script src=&quot;.\/dist\/jquery.magnific-popup.js&quot;&gt;&lt;\/script&gt;\r\n<\/pre>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_3.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_3-300x137.jpg\" alt=\"js_animated_jquery_magnific_popup_lightbox_plugin_implementing_3\" width=\"300\" height=\"137\" class=\"alignnone size-medium wp-image-31510\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_3-300x137.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_3-150x68.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_3.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li> \r\n\r\n<li>Find the  line with the image e.g.<\/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>And change  it to<\/li>\r\n\r\n<pre class=\"brush:html\">\r\n&lt;a class=&quot;image-popup-vertical-fit&quot; href=&quot;images\/image_big.jpg&quot; title=&quot;Title&quot;&gt;\r\n    &lt;img src=&quot;images\/image_small.jpg&quot;&gt;\r\n&lt;\/a&gt;\r\n<\/pre>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_4.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_4-300x136.jpg\" alt=\"js_animated_jquery_magnific_popup_lightbox_plugin_implementing_4\" width=\"300\" height=\"136\" class=\"alignnone size-medium wp-image-31511\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_4-300x136.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_4-150x68.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_4.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>  \r\n  \r\n<li>In the  images folder there should be image_big.jpg and image_small.jpg accordingly.<\/li>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_5.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_5-300x161.jpg\" alt=\"js_animated_jquery_magnific_popup_lightbox_plugin_implementing_5\" width=\"300\" height=\"161\" class=\"alignnone size-medium wp-image-31512\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_5-300x161.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_5-150x80.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_5.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>  \r\n  \r\n<li>To initialize  the popup, add the following to your <strong>.html <\/strong>file right before the closing <strong>&lt;\/head&gt;<\/strong>  tag or in the footer of your site (before the closing <strong>&lt;\/body&gt;<\/strong> tag:<\/li>\r\n\r\n<pre class=\"brush:js\">\r\n&lt;script&gt;\r\n$(document).ready(function() {\r\n \r\n    $('.image-popup-vertical-fit').magnificPopup({\r\n        type: 'image',\r\n        closeOnContentClick: true,\r\n        mainClass: 'mfp-img-mobile',\r\n        image: {\r\n            verticalFit: true\r\n        }\r\n         \r\n    });\r\n \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_magnific_popup_lightbox_plugin_implementing_6.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_6-300x138.jpg\" alt=\"js_animated_jquery_magnific_popup_lightbox_plugin_implementing_6\" width=\"300\" height=\"138\" class=\"alignnone size-medium wp-image-31513\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_6-300x138.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_6-150x69.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_6.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>  \r\n  \r\n<li>Save the  changes and\u00a0check your page in a web browser: the image should be opening  in a lightbox with a title. Your site should be up and running on a  remote\/local server to see the plugin in action.<\/li>\r\n<\/ol>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_7.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_7-300x152.jpg\" alt=\"js_animated_jquery_magnific_popup_lightbox_plugin_implementing_7\" width=\"300\" height=\"152\" class=\"alignnone size-medium wp-image-31514\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_7-300x152.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_7-150x76.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/12\/js_animated_jquery_magnific_popup_lightbox_plugin_implementing_7.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n  \r\n<p>For more  information on how to use the plugin, please refer to the official manual at: <a href=\"http:\/\/dimsemenov.com\/plugins\/magnific-popup\/documentation.html#initializing_popup\" target=\"_blank\" rel=\"nofollow\">http:\/\/dimsemenov.com\/plugins\/magnific-popup\/documentation.html#initializing_popup<\/a><\/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=p9FLFSed4cs?width=1280&amp;height=720\" rel=\"prettyPhoto\">JS Animated. How to implement jQuery &#8220;Magnific Popup&#8221; lightbox plugin<\/a>","protected":false},"excerpt":{"rendered":"<p>This  tutorial is going to show you how to implement the jQuery Magnific Popup  lightbox plugin into your JS Animated template.<\/p>\n","protected":false},"author":30,"featured_media":31526,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1016,253,270],"tags":[1574,827,1575,1191,1363],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/31507"}],"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=31507"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/31507\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/31526"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=31507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=31507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=31507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}