jQuery hide() not hiding div
html, jquery
Solution
printerMenuClose click event bubbles up and it shows the printerMenu again. To hide it stop the event propagation.
This should work
$(document).ready(function () {
$("#printer").click(function () {
$("#printerMenu").show();
});
$("#printerMenuClose").click(function (e) {
$("#printerMenu").hide();
e.stopPropagation();
});
});
Fiddle here
You can also read more about event propagation:
http://api.jquery.com/event.stoppropagation/
Problem
I have the problem is a jsfiddle here: http://jsfiddle.net/luisfalcon/wPEhW/ Basically if you try to close the window it won't do it. If I remove the show() section of the js it will close it! ``` $(document).ready(function () { $("#printer").click(function () { $("#printerMenu").show(); }); $("#printerMenuClose").click(function () { $("#printerMenu").hide(); }); }); ``` Something tells me that this is a very simple fix but I can't find the answer! Thanks in advance