• Resolved Garrett Hyder

    (@garrett-eclipse)


    Hello,

    I just wanted to share a quick little jQuery snippet for making ImageMapper images responsive;

    
    // Responsive ImageMapper - Resize Mapster on Window Resize
    jQuery(document).ready(function($) {
        if ($('img[usemap]').length) {
            $(window).resize( function() {
                $('img[usemap]').each(function() {
                    $(this).mapster('resize',$(this).closest('.imgmap-frontend-image').width());
                });
            });
        }
    });
    

    Note: You need to make sure this is enqueued after the imagemapper scripts and jquery.

    Hope others find this useful,
    Cheers

    • This topic was modified 7 years, 8 months ago by Garrett Hyder. Reason: *Fixed the code block formatting
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Solution: Make ImageMapper Responsive’ is closed to new replies.