答案 0 :(得分:2)
可以请参考或修改您的代码,如下所示:
HTML:
.img_box {
display: inline-block;
position: relative;
cursor: pointer;
}
.img_box span {
background-color: rgba(0,0,0,0.7);
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: none;
}
CSS:
$('body').on('click','.image',function() {
$(this).next().fadeIn();
});
$('body').on('click','.image + span',function() {
$(this).fadeOut();
});
JS:
shiftIn