//禁用页面退格键
document.onkeydown = function() {
var bjtBack = document.activeElement;
var tBack = objtBack.type || objtBack.getAttribute('type'); //获取事件源类型
if (tBack != "password" && tBack != "text" && tBack != "textarea") {
if (event.keyCode == 8) {
event.returnValue = false;
}
}
}
//页面悬浮框
$(window).scroll(function() {
var bodyTop = 0;
if (typeof window.pageYOffset != 'undefined') {
bodyTop = window.pageYOffset
} else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
bodyTop = document.documentElement.scrollTop
} else if (typeof document.body != 'undefined') {
bodyTop = document.body.scrollTop
}
$("#hellobaby").css("top", 250 + bodyTop)
});
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26481450/viewspace-753906/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26481450/viewspace-753906/