#after{
position: absolute;
top: 0px;
left: 0px;
background-image: url(../images/24.jpg);
width: 940px;
height: 529px;
background-repeat: no-repeat;
}
#before{
position: absolute;
top: 0px;
left: 0px;
border-right: 3px solid #f00;
background-image: url(../images/23.jpg);
width: 433px;
height: 529px;
background-repeat: no-repeat;
max-width: 940px;
}
function RollImage(evt){
var x=evt.pageX;
console.log(x);
$("#before").css("width",x+"px");
}
/script>
.beforeafter{
width: 940px;
height: 529px;
}
#after{
position: absolute;
top: 0px;
left: 0px;
background-image: url(../images/24.jpg);
width: 940px;
height: 529px;
background-repeat: no-repeat;
}
#before{
position: absolute;
top: 0px;
left: 0px;
border-right: 3px solid #f00;
background-image: url(../images/23.jpg);
width: 433px;
height: 529px;
background-repeat: no-repeat;
max-width: 940px;
}
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml"><head>
<title>日本地震灾区前后对比</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="zh-CN">
<link href="css/roll.css" type="text/css" rel="stylesheet">
<script src="../jquery-1.8.3.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
function RollImage(evt){
<strong>var x=evt.pageX;
$("#before").css("width",x+"px");</strong>
}
</script>
</head>
<body>
<div class="beforeafter" onmousemove="RollImage(event)">
<div id="after"></div>
<div id="before"> </div>
</div>
</body>
</html>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有