这就是我正在做的工作:http://jsfiddle.net/wppjq1a3/
$(document).ready(function(){
$('.sec-img').click(function() {
$(this).css({
height: '100%',
width: '100%'
});
});
});
我希望它能做的是:
发布于 2014-09-25 06:17:49
试试看:
http://jsfiddle.net/wppjq1a3/2/
我没有将css添加到jquery中,而是切换了一个类。我增加了一个红色的背景颜色,所以当你在悬停时,因为不透明被拒绝,我想要确保我点击的div出现在前面。我还增加了一个绝对位置,和一个z-
jQuery:
$(document).ready(function(){
$('.sec-img').click(function() {
$(this).toggleClass("expand");
});
});
CSS:
.expand{
width:100% !important;
height:100% !important;
position: absolute;
z-index:999999 !important;
}
https://stackoverflow.com/questions/26039375
复制相似问题