Html
    Css
    Js

    
                        
* {
	margin:0;
	padding:0;
}
#demo {
	display:block;
	width:400px;
	height:255px;
	margin:50px;
	position:relative;
	border:1px solid #ccc;
}
#mark {
	position:absolute;
	display:block;
	width:400px;
	height:255px;
	background:#fff;
	opacity:0;
	/*兼容处理*/
	filter:alpha(opacity = 0);
	z-index:10;
}
#small-box {
	position:absolute;
	z-index:1;
}
#small-box img {
	width:400px;
	height:255px;
}
#float-box {
	display:none;
	width:160px;
	height:120px;
	position:absolute;
	background:#f0f;
	border:1px solid #ccc;
	opacity:0.5;
	filter:alpha(opacity=50);
	cursor:move;
}
#big-box {
	display:none;
	position:absolute;
	top:0;
	left:460px;
	height:100px;
	width:100px;
	overflow:hidden;
	border:1px solid #ccc;
	z-index:1;
}
#big-box img {
	position:absolute;
	z-index:5;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

淘宝商品放大镜效果

淘宝放大镜效果,鼠标左侧滑动右侧会出现放大的效果

0