[阅读: 543] 2007-06-24 07:25:44
样式部分:
<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>