我有这段代码来禁用所有文本选择.除了输入外,我如何禁用所有文本?我试过 $('* :not(input)').disableTextSelect();但它禁用了一切的选择(包括输入)
$.extend($.fn.disableTextSelect = function () {
return this.each(function () {
if ($.browser.mozilla) {//Firefox
$(this).css('MozUserSelect', 'none');
} else if ($.browser.msie) {//IE
$(this).bind('selectstart', function () { return false; });
} else {//Opera, etc.
$(this).mousedown(function () { return false; });
}
});
});
$('* :not(input)').disableTextSelect();
Run Code Online (Sandbox Code Playgroud) 我试图通过警报以及弹出模态窗口时显示窗口和文档的高度.我知道我需要使用$(window).height();&$(document).height();但除此之外我不知道该怎么做.
编辑:我想解决的问题是我的模态窗口是在文档的底部添加额外的像素,所以我试图找出原始文档的高度和激活模态窗口后的高度.