js怎么实现不了固定层,已测试JS代码没有问题
<divid="ss"style="position:absolute;min-width:180px;height:600px;top:30px;left:22px;"...
<div id="ss" style="position: absolute; min-width: 180px; height: 600px; top: 30px; left: 22px;">
<div
style=" height:100%; width:100%;;background-color: #000; opacity: 0.5;
-moz-opacity: 0.5; filter: alpha(opacity=50); position:absolute;
z-index:-1;border-radius: 10px; " ></div>
<div
style="width:100%; height:103px; border-bottom-color:#FFF;
border-bottom-style:solid; border-bottom-width:1px;"><input
type="image" src="3_201001091526481Pi33.jpg" width="180px"
height="100px" style="border-radius: 10px;"></div>
<script>
window.onscroll=function(){
var oTextbox=document.getElementById( "ss");
//document.body.scrollLeft,它保持窗口在水平方向上卷动的距离
//document.body.scrollTop,它保持窗口在垂直方向上的距离.
oTextbox.style.top=document.body.scrollTop+30;
oTexbox.style.left=document.body.scrollLeft+22;
}
</script> 展开
<div
style=" height:100%; width:100%;;background-color: #000; opacity: 0.5;
-moz-opacity: 0.5; filter: alpha(opacity=50); position:absolute;
z-index:-1;border-radius: 10px; " ></div>
<div
style="width:100%; height:103px; border-bottom-color:#FFF;
border-bottom-style:solid; border-bottom-width:1px;"><input
type="image" src="3_201001091526481Pi33.jpg" width="180px"
height="100px" style="border-radius: 10px;"></div>
<script>
window.onscroll=function(){
var oTextbox=document.getElementById( "ss");
//document.body.scrollLeft,它保持窗口在水平方向上卷动的距离
//document.body.scrollTop,它保持窗口在垂直方向上的距离.
oTextbox.style.top=document.body.scrollTop+30;
oTexbox.style.left=document.body.scrollLeft+22;
}
</script> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询