————css————–
/全屏显示大图/
.opacityBottom{
width: 100%;
height: 90%;
position: fixed;
background:rgba(0,0,0,0.8);
z-index:1000;
top: 0;
left: 0
}
.none-scroll{
overflow: hidden;
height: 90%;
}
.bigImg{
width:100%;
height:100%;
left:0%;
top:0%;
position:fixed;
z-index: 10001;
}
———-js————–
function clickToBigImg(obj){//绑定图片函数 //var clickImgId = (this).attr("id");varimgsrc= ( t h i s ) . a t t r ( " i d " ) ; v a r i m g s r c = (obj).attr("src"); var opacityBottom = 'toBigImg();//变大函数
}
function toBigImg(){ (document.body).append(opacityBottom); toBigImg();//变大函数 } function toBigImg(){ ("#opacityBottom").addClass("opacityBottom"); ("#opacityBottom").show(); ("#opacityBottom").show(); ("html,body").addClass("none-scroll");//下层不可滑动 (".bigImg").addClass("bigImg");/∗隐藏∗/ ( " . b i g I m g " ) . a d d C l a s s ( " b i g I m g " ) ; / ∗ 隐 藏 ∗ / ("#opacityBottom").bind("click",clickToSmallImg); (".bigImg").bind("click",clickToSmallImg);varimgHeight= ( " . b i g I m g " ) . b i n d ( " c l i c k " , c l i c k T o S m a l l I m g ) ; v a r i m g H e i g h t = (".bigImg").prop("height"); if(imgHeight