Your Location is: Home > Jquery

Can't get jQuery to fire when HOTSPOT is clicked

From: Moldova, View: 4624 brandydoll 

Question

I tried numerous suggestions, but nothing worked with my particular jquery. This script hides the double scrollbar when my popup is opened. It works great on regular images. But I can't get it to fire from a hotspot/map. I tried putting my class "pop-open" in the image tag, area tag, and even the map tag lol. Can somebody help me? Thx in advance.

<map name="hotspot"><area class="pop-open" shape="rect" coords="0, 0, 150, 200" href="#pop_vid"></map><img src="example.com/images/whatever.png" usemap="#hotspot">



$(document).ready(function(){
$('.pop-open').click(function() {
        $('body').css({
        'overflow': 'hidden',
        });
    });
$('.lightbox').click(function() {
        $('body').css({
        'overflow': 'visible',
        });
    });
});

p.s. If somebody can tell me how to put 2 selectors in where I have lightbox it would be VERY appreciated. Really I want to use classes close-x and close-btn, but since I couldn't figure it out, I had to set it to close the whole lightbox. I tried this which made neither class work.

$('.close-x, .close-btn').click(function() {

Best answer

This is solved. It actually DOES work. I'm having a conflict with another modal script, that's the issue. Posting a separate question about that. I didn't figure out my p.s. up there ^ but oh well.