I’ve a menu with slideUp and SlideDown.
The user clicks in menuArea and the menu is opened and an image with a cross becomes visible.
To close the button the user click in the image, and that image becomes invisible.
I’m having a problem in this step.
Look at this fiddle: http://jsfiddle.net/pedroR/7YNJY/3/
NOTE: See this fiddle in Chrome or IE because of the image
Thanks
The problem is that the
imgis contained within the#menuTextelement. That means when you click theimgelement, the click event handler for#menuTextis also fired, and when that runs, it fades theimgback in.You can prevent that by adding an argument to the
imgclick event handler, and callingstopPropagationto prevent the event from bubbling up:Here’s a working example.