disable shadowbox when not open

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

disable shadowbox when not open

MWebsites
Hi Guys

i am building a website with a slideshow, but on the page to open the slideshow there is also some navigation using the arrow keys

so the script is this

if(Shadowbox.isOpen() === false){
    $(document).keydown(function(e){
        if (e.keyCode == 37) {
        window.open("picture.php?id=<?php echo "".$previmg."" ?>", "_self");    
            return false;
        }
    });

    $(document).keydown(function(e){
        if (e.keyCode == 39) {
        window.open("picture.php?id=<?php echo "".$nextimg."" ?>", "_self");    
            return false;
        }
    });
}

the problem is the if statement, I tried multiple things (check if sb-container is hidden etc.), but they all didn't really work. I'm kinda new with jQuery and javascript so I probably don't know about some option or so

would be great if you could help me