jquery disable parts of page
I am displaying a modeless jquery dialog on top of a page. When the dialog is displayed I wish to only allow the user to interact with a certain portion of the page (mainl开发者_JS百科y because I do not want them naving away or clicking other controls that cause postbacks). I thought it would work well to use the same mechanism that jquery uses with a modal dialog except instead of disabling the entire page, disable all but the portion I wish to remain active. Does someone know how jquery modal dialog does this or have a better suggestion?
If you only want to prevent posting/navigation, then use window.unload
to capture and prevent the event.
If you need to selectively disable input controls, then apply the disabled
property to those controls.
You can do this easily by assigning a class to every object that you want to disable or enable for a given circumstance, e.g. with jquery
$('.blocked-input-controls').prop('disabled',true);
精彩评论