中国开发网: 论坛: 程序员情感CBD: 贴子 529266
mhappy
偶们主页的一段代码,供参考。。。
样式部分:
<style>
<!--
.lrimg{
margin-top: 100px
}

#LayerLeft {
position:fixed;
left:0px;
width:120px;
height:400px;
z-index:1;
}
* html #LayerLeft{position:absolute;}


#LayerRight {
position:fixed;
left:884px;
width:120px;
height:400px;
z-index:2;
}
* html #LayerRight{position:absolute;}

-->
</style>
<!--[if IE 6]>
<style type="text/css">
/*<![CDATA[*/
html {overflow-x:auto; overflow-y:hidden;}
/*]]>*/
</style>
<![endif]-->


DIV定义:
<div id="LayerLeft" align="right"><img id="imgLeft" class="lrimg" src="pic/l11.gif" width=90 height=360> </img></div>
<div id="LayerRight" align="left"><img id="imgRight" class="lrimg" src="pic/l22.gif" width=90 height=360> </img></div>

<script language="JavaScript" type="text/JavaScript">
if(screen.width<1024)
{ imgLeft.style.width = 0;
imgRight.style.width = 0;
}
else
{ LayerLeft.style.left = (screen.width-760-20)/2-120;
LayerRight.style.left =(screen.width-20+760)/2;
}
</script>

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录