this may sound like a silly questions but is there something I can call for offclick events for exmaple I have this currently;
$("#frame_left").click(function() {
$("#navLeft").show();
});
I want to hide the #navLeft
content once a user has clicked off of the radio button?
Add a click event for the entire document:
$(document).click(function(e) {
$('#navLeft').hide();
});
Then stop propagation on the element, so it doesn't bubble up to the document:
$("#frame_left").click(function(e) {
e.stopPropagation();
$("#navLeft").show();
});
http://api.jquery.com/event.stopPropagation/
This should work for you:
$('html').click(function() {
$("#navLeft").hide();
});
And then be sure to prevent the event from propagating when clicking the #frame_left
element:
$("#frame_left").click(function(e) {
$("#navLeft").show();
e.stopPropagation();
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With