兼容各浏览器的
解决方案 »
- 帮帮忙,在ext里怎么设置所有的子节点和有子节点的子节点一次性展看
- 关于在网页中处理frame事件的问题,高手来啊,很有挑战性!!!!
- jquery如何取第一级子tr标签(多层表格)
- 请教一个疑难问题
- DIV中文本样式的问题~~~~~~求助!
- 怎么在 iframe 里调用本地文件
- [extjs]求教画chart图的时候,如何处理横坐标
- 百年不遇的难题!!在线等待各位高手的解答!!分不够可以再加,先谢了!!
- 请问如何在javascript中创建xml对象?
- 请教:怎样将一个文本框的内容加到几个列表框去
- js 获得window.open打开的窗口大小
- ext tabpanel autoload的问题
function getScrollTop() {
var scrollPos = 0;
if (typeof window.pageYOffset != 'undefined') {
scrollPos = window.pageYOffset;
}
else if (typeof window.document.compatMode != 'undefined' &&
window.document.compatMode != 'BackCompat') {
scrollPos = window.document.documentElement.scrollTop;
}
else if (typeof window.document.body != 'undefined') {
scrollPos = window.document.body.scrollTop;
}
return scrollPos;
}
if(window.innerWidth){ // 除了IE
geometry.getHScroll=function(){
return window.pageXOffset;
}
geometry.getVScroll=function(){
return window.pageYOffset;
}
}else if(document.documentElement && document.documentElement.clientWidth){ //有定义DOCTYPE 的 IE 6
geometry.getHScroll=function(){
return document.documentElement.scrollLeft;
}
geometry.getVScroll=function(){
return document.documentElement.scrollTop;
}
}else if(document.body.clientWidth){ //没有定义DOCTYPE的其它IE版本
geometry.getHScroll=function(){
return document.body.scrollLeft;
}
geometry.getVScroll=function(){
return document.body.scrollTop;
}
}别人以前写的,给你用吧