我有一个简单的模态脚本,过去可以正常工作,但由于某种原因,它会在第 10 张图像之后拒绝工作。
<div class = "images_container"> <!-- Image 1 -->
<div class = "images image_1">
<div class = "hover_alpha">
<div class = "plus">
</div>
</div>
</div>
<div class = "images image_2"> <!-- Image 2 -->
<div class = "hover_alpha">
<div class = "plus">
</div>
</div>
</div>
<div class = "images image_3"> <!-- Image 3 -->
<div class = "hover_alpha">
<div class = "plus">
</div>
</div>
</div>
<div id="image_1_content">
<img src = "images/1.jpg">
</div>
<div id="image_2_content">
<img src = "images/2.jpg">
</div>
<div id="image_3_content">
<img src = "images/3.jpg">
$('.image_1').click(function () {
$('#image_1_content').modal({
close: true,
overlayClose:true,
position: [150,70],
opacity:80,
overlayCss: {backgroundColor:"#fff"}
});
return false;
});
$('.image_2').click(function () {
$('#image_2_content').modal({
close: true,
overlayClose:true,
opacity:80,
position: [150,70],
overlayCss: {backgroundColor:"#fff"}
});
return false;
});
$('.image_3').click(function () {
$('#image_3_content').modal({
close: true,
overlayClose:true,
opacity:80,
position: [150,70],
overlayCss: {backgroundColor:"#fff"}
});
return false;
});
该代码与第 21 张图像几乎相同。但是,从第 10 个图像开始,该脚本在第 9 个图像之后拒绝工作。我对为什么或如何发生这种情况感到困惑。有输入吗?