function bodyHeight(){ var cobj = document.body; while(cobj.scrollTop == 0 && cobj.parentNode) { if(cobj.tagName.toLowerCase() == 'html') break; cobj = cobj.parentNode; } return cobj.clientHeight; } function scrolltop(){ var cobj = document.body; while(cobj.scrollTop == 0 && cobj.parentNode) { if(cobj.tagName.toLowerCase() == 'html') break; cobj = cobj.parentNode; } return cobj.scrollTop; }
不过以上在Jquery中就非常简单了,$(window).height() + $(window).scrollTop();
鼠标Y event.clientY
鼠标X event.clientX
留下你的看法: