jquery - hide only when i click outside -
i don't want hide when click input. http://jsfiddle.net/bthnh/1/
$("body").click(function() { $(".search-input").hide(); }); $("#search").click(function () { $(".search-input").toggle(); event.stoppropagation(); });
$(document).click(function (event) { //alert(event.target.classname); if(event.target.classname != 'search-input') { $(".search-input").hide(); } }); $("#search").click(function (event) { event.stoppropagation(); $(".search-input").toggle(); });
Comments
Post a Comment