用js实现控制内容的向上向下滚动效果_表单特效
- WBOY原创
- 2016-05-16 19:12:031121浏览
<script> <BR>if (iens6) <BR>document.write('') <BR></script>
<script> <BR>if (iens6){ <BR>var crossobj=document.getElementById? document.getElementById("content") : document.all.content <BR>var contentheight=crossobj.offsetHeight <BR>} <BR>else if (ns4){ <BR>var crossobj=document.nscontainer.document.nscontent <BR>var contentheight=crossobj.clip.height <BR>} <br><br>function movedown(){ <BR>if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100)) <BR>crossobj.style.top=parseInt(crossobj.style.top)-speed <BR>else if (ns4&&crossobj.top>=(contentheight*(-1)+100)) <BR>crossobj.top-=speed <BR>movedownvar=setTimeout("movedown()",100) <BR>} <br><br>function moveup(){ <BR>if (iens6&&parseInt(crossobj.style.top)<=0) <BR>crossobj.style.top=parseInt(crossobj.style.top)+speed <BR>else if (ns4&&crossobj.top<=0) <BR>crossobj.top+=speed <BR>moveupvar=setTimeout("moveup()",100) <br><br>} <br><br>function getcontent_height(){ <BR>if (iens6) <BR>contentheight=crossobj.offsetHeight <BR>else if (ns4) <BR>document.nscontainer.document.nscontent.visibility="show" <BR>} <BR>window.onload=getcontent_height <BR></script>
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn