How to easily show before and after photo slider in Shopify

Hura Product Showcase Builder

Do you want to show the before and after photos on your Shopify store? A before and after photo can be useful to display side by side comparison of two identical images with minor differences. Perfect for anyone in the beauty or fitness business, photographers, designers, gardeners, builders and more.

DEMO

In this article, I will share how to easily show before and after photo in Shopify.

  • From your Shopify admin, go to Online Store > Themes.
  • Find the theme you want to edit, and then click Actions > Edit code.
  • In the Layout section, click theme.liquid to open the file in the online code editor.
  • Find </head> and paste the below code just above it.
  • Click Save.

It’s easy to get started, just wrap two images inside of a container with class name “twentytwenty-container“. The first image will be on the left and the second one will be on the right. Here’s an example container:

Happy coding!

Hura Theme Blocks

You may also like...

19 Responses

  1. Tupac says:

    i’m lost after putting the code in the header theme.liquid , and then where to do i “wrap the images”

  2. Marc says:

    I followed exactly the tutorial but nothing happened, the images doesn’t even appear.
    Can someone help

  3. Marc Kadi says:

    I tried but still nothing 🙁
    //ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js
    {{ ‘//cdnjs.cloudflare.com/ajax/libs/mhayes-twentytwenty/1.0.0/js/jquery.twentytwenty.min.js’ | script_tag }}
    {{ ‘//cdnjs.cloudflare.com/ajax/libs/mhayes-twentytwenty/1.0.0/js/jquery.event.move.min.js’ | script_tag }}
    {{ ‘//cdnjs.cloudflare.com/ajax/libs/mhayes-twentytwenty/1.0.0/css/twentytwenty.min.css’| stylesheet_tag }}
    $(function(){$(‘.twentytwenty-container’).twentytwenty();});

  4. N A says:

    Hi could you help me with this as well. i did it all wrong i think..
    Kind regards

  5. FLO says:

    I tried but nothing ? Could you help me please ?

  6. Mimi says:

    It worked for me when I put all of this in this order right before the closing tag in theme.liquid:

    //ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js
    {{ ‘//ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js’ | script_tag }}
    {{ ‘//cdnjs.cloudflare.com/ajax/libs/mhayes-twentytwenty/1.0.0/js/jquery.twentytwenty.min.js’ | script_tag }}
    {{ ‘//cdnjs.cloudflare.com/ajax/libs/mhayes-twentytwenty/1.0.0/js/jquery.event.move.min.js’ | script_tag }}
    {{ ‘//cdnjs.cloudflare.com/ajax/libs/mhayes-twentytwenty/1.0.0/css/twentytwenty.min.css’| stylesheet_tag }}
    $(function($){$(‘.twentytwenty-container’).twentytwenty();});

    • Mimi says:

      Nevermind …….. It only works when reloading the page. I guess I placed the div in a bad spot as it isn’t loading the scripts first?

  7. Dovify says:

    it worked thanks so much, can i edit the “before and after” cuz i aint selling on US market ? thanks so much anyway

  8. Zay says:

    I did everything and it not working. The pictures are not showing. Please, help

Leave a Reply

Your email address will not be published. Required fields are marked *