jquery 屏蔽元素


<script type="text/javascript">
(function($) {
$.fn.disable = function() {
/// <summary>
/// 屏蔽所有元素
/// </summary>
/// <returns type="jQuery" />
return $(this).find("*").each(function() {
$(this).attr("disabled", "disabled");
});
}
$.fn.enable = function() {
/// <summary>
/// 使得所有元素都有效
/// </summary>
/// <returns type="jQuery" />
return $(this).find("*").each(function() {
$(this).removeAttr("disabled");
});
}
})(jQuery);
</script>

posted @ 2014-04-29 16:34  lengv10  阅读(294)  评论(0编辑  收藏  举报