Chinaunix首页 | 论坛 | 博客
  • 博客访问: 179959
  • 博文数量: 148
  • 博客积分: 2615
  • 博客等级: 少校
  • 技术积分: 1645
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-23 13:43
文章分类

全部博文(148)

文章存档

2010年(1)

2009年(111)

2008年(36)

我的朋友
最近访客

分类:

2009-01-20 19:37:43

有时为了准确定位一个元素,我们需要获取滚动条的位置,这种需求经常出现在 tooltip 和 拖放等应用中,其实这个技术很简单,关键是要 考虑浏览器的兼容性,本文就是介绍这一问题的解决方法. document.write(’
”{$cs}”
’); document.write(’
’); document.write(’在线客服:您好,有什么可以帮助您的吗?
’); document.write(’ ’); document.write(’’); document.write(’
’); function movefloat(){ var ht=getst(); var fcs=document.getElementById(’floatcs’); var fcsin=document.getElementById(’fcsin’); var vol=ht+150; var vor=ht+300; fcs.style.top=vol+’px’; fcsin.style.top=vor+’px’; } function gochat(){ window.location=”{$id}”; } function closefcsin(){ var fcsin=document.getElementById(’fcsin’); fcsin.style.visibility=”hidden”; } function getst(){ var t; if (document.documentElement && document.documentElement.scrollTop) { t = document.documentElement.scrollTop; } else if (document.body) { t [...]
阅读(304) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~