当前位置: 代码迷 >> ASP.NET >> 做了个母版页,有俩个div,其中一个div1是一个小窗口,随着滚动条的滚动而滚动,该怎么解决
  详细解决方案

做了个母版页,有俩个div,其中一个div1是一个小窗口,随着滚动条的滚动而滚动,该怎么解决

热度:4073   发布时间:2013-02-25 00:00:00.0
做了个母版页,有俩个div,其中一个div1是一个小窗口,随着滚动条的滚动而滚动,
<script   language= "javascript ">
function   init()
{
document.all.div1.style.pixelLeft   =   document.body.clientWidth   -   document.all.div1.style.pixelWidth;
document.all.div1.style.pixelTop     =   10;
window.document.body.onresize   =   resizeDiv;
timer_name   =   setInterval( "timer_func(); ",100);
}

function   resizeDiv()
{
document.all.div1.style.pixelLeft   =   document.body.clientWidth   -   document.all.div1.style.pixelWidth;
document.all.div1.style.pixelTop     =   0;
}

function   timer_func()
{
document.all.div1.style.pixelTop   =   document.body.scrollTop+10;
}
</script>

<body       onload= "init() ">

<form   id= "default_master "   runat= "server ">    
<div>
</div>
    </form>

<div   style= "position:absolute;text-align:   center;left:0;top:0;width:89;height:100;background-color:yellow "   id=div1   >
内容
</div>
</body>

</HTML>


在html是正常滚动的,可一放到母版页中就不行了,谁给看看

------解决方案--------------------------------------------------------
网上重新找个,嘿嘿。