61,129
社区成员




<script type="text/javascript">
function imgCenter(){ //新增部分
var H = $("#spec-n1 img").height();
var W = $("#spec-n1 img").width();
$("#spec-n1 img").css({
"position":"absolute",
"top":"50%",
"left":"50%",
"margin-left":"-"+W/2+"px",
"margin-top":"-"+H/2+"px"
});
}
$(function(){
imgCenter(); //新增部分
$(".jqzoom").jqueryzoom({
xzoom:400,
//此处代码省略.........
//此处代码省略.........
$("#spec-n1 img").eq(0).attr({
src:src.replace("/n5/","/n1/"),
jqimg:src.replace("/n5/","/n0/")
});
imgCenter(); //新增部分
$(this).css({
"border":"2px solid #ff6600",
//此处代码省略.........
//此处代码省略.........
</script>
<style>
*{ margin:0; padding:0;}
#preview{ width:400px; height:298px; padding:14px; background:url(http://www.vanjoinmcm.com/images/fsdfa_03.gif) no-repeat; margin:100px auto;}
.jqzoom{ width:400px; height:298px; line-height:298px; font-size:16px; text-indent:-1em; overflow:hidden;}
.jqzoom img{ width:400px; max-height:298px; vertical-align:middle;}
</style>
<div id="preview">
<div class="jqzoom">大<img src="http://www.vanjoinmcm.com/d/file/chanpinzhanshi/rouxingpikaizhuan1/hanyuntangfeng%E2%80%94huoshanmian/2017-05-05/ff2b6fb822edbf8b8a90ca425946a348.jpg">
</div>
</div>