I have div that goes in to an edit mode... the div contains buttons, links++. In edit mode i want to disable all开发者_开发技巧 of these, and enable them when i exit edit mode.
Ive tried
$("#container").children().disableSelection();
but it does not work :-(
Edit mode enter:
$("#container").children().bind('click', function(){ return false; });
Edit mode exit:
$("#container").children().unbind('click');
Give all elements that you want to prevent clicking a class of "noclick", then when in edit mode:
$(".noclick").click(function(e) {
if(editMode) {
e.preventDefault();
}
});
you use below that will help you:
$("#container").hide();
and when exit edit mode do: $("#container").show();
css:
.dis{pointer-events:none}
Jquery:
$("#container").addClass("dis"); //disables
$("#container").removeClass("dis"); //enables
精彩评论