Showing an image on the side of the same page after click the thumbnail

Hey @remedina18 !

A team member has come up with some awesome code for this. Here’s a short video + the code used.

Code - placed in the JavaScript tab of the page

displayComponent = "component_X";
jQuery('body').on('click', '.image-col a, .image-col img', function(e) {
    e.preventDefault();
    if($(this).is("img")){
        url = $(this).attr("src")
    } else {
        url = $(this).attr("href")
    }
    $('[data-obj-id="'+displayComponent.replace("component_", "")+'"]').html("<img src='"+url+"' class='img-responsive'>");
});
1 Like