I have a button on my website that I'd like to use to toggle on and off a description box. So when the button is clicked, I want it to show an image preview when you hover over certain elements on the page, but when the button is deselected, it should not show any image previews.

I created a jQuery function and pass it a boolean based on whether the image preview window should or should not show. However, it seems like the hover function ( $(".node").hover(function(e)) is being called regardless of the boolean. What am I doing wrong?