Add Fancybox in your blog page in shopify

1. Add below js and css in your blog.liquid file:
{{ 'jquery.fancybox.js' | asset_url | script_tag }}
{{ 'jquery.fancybox.css' | asset_url | stylesheet_tag }}
{{ 'jquery.fancybox-thumbs.css' | asset_url | stylesheet_tag }}
{{ 'jquery.fancybox-thumbs.js' | asset_url | script_tag }}

Add script in same file
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
   $('.fancybox').fancybox({
            closeBtn  : true,
            arrows    : true,
            nextClick : true,
          });
});
</script>
2. Blog post page:
<div class="detail_images">
<p>
     <a class="fancybox" href="//cdn.shopify.com/s/files/1/0259/2189/files/9._Hoop_Earrings_large.jpg?v=1491472942">
    <img src="//cdn.shopify.com/s/files/1/0259/2189/files/9._Hoop_Earrings_large.jpg?v=1491472942" alt="Hoop Earrings" />
    </a>
</p>
</div>

Comments

Popular posts from this blog

Application ld json data in shopify

on_sent_ok not working in Contact Form 7 version 5.0.2

Make carousel slider in shopify