1つのポップアップを調光器で表示したい場合はコードがありますが、複数のポップアップを表示する場合はうまく動作します。私は本当にいくつかの助けに感謝されるように複数を行うためにそれを再加工する方法については本当にわからない。私は調光器jquerysで他のポップアップを見つけることを試みたが、それらのどれも複数のために働くようではない。jquery複数のポップアップ(調光器)
//This is the function that closes the pop-up
function endBlackout(){
$(".blackout").css("display", "none");
$(".msgbox").css("display", "none");
}
//This is the function that closes the pop-up
function strtBlackout(){
$(".msgbox").css("display", "block");
$(".blackout").css("display", "block");
}
//Sets the buttons to trigger the blackout on clicks
$(document).ready(function(){
$("#btn1").click(strtBlackout); // open if btn is pressed
$("#btn2").click(strtBlackout); // open if btn is pressed
$(".blackout").click(endBlackout); // close if click outside of popup
$(".closeBox").click(endBlackout); // close if close btn clicked
});
.blackout {
background-color:#000;
opacity:.7;
filter:alpha(opacity=70);
height:100%;
width:100%;
position:fixed;
top:0;
left:0;
z-index:301;
display:none;
cursor:pointer;
}
.msgbox {
background-color:#ccc;
color:#000;
width:70%;
height:60%;
position:fixed;
top:20%;
left:15%;
border-radius:20px;
padding:10px;
z-index:302;
display:none;
}
.closeBox {
background-color:#CC0000;
color:#FFFFFF;
padding:8px;
float:right;
border-radius:3px;
cursor:pointer;
text-transform:uppercase;
}
<script src="http://code.jquery.com/jquery-latest.js"></script>
<div class="blackout"></div>
<div class="msgbox">
<div class="closeBox">Close</div>
Message Goes Here
</div>
<input type="button" id="btn1" value="Click Here" />
質問は何である私はもっとして1つのポップとの1、より多くを持っている場合、私は一つのボタンを持っていますが、ない場合は、この作品 –
それをより明確にするために言い替えるしてみてください?アップ – Felicyia