複数のjqueryポップアップボックスを持つように機能するスクリプトがあります。文字列と ID で div を取得します。これがJavascriptです...
function POPUP(string,id){
var closebtn = '<img src="i/JqueryClose.png" onClick="CLOSEPOP('+id+')" title="Close" class="close">';
$('closebtn'+id).css('{margin: -30px -30px 0 0}');
$('#Popup'+id).html(closebtn+id);
$('#Popup'+id).fadeIn(300);
onLoad: true;
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set height and width to mask to fill up the whole screen
$('#mask').css({'width':maskWidth,'height':maskHeight});
//transition effect
$('#mask').fadeIn(300);
$('#mask').fadeTo("slow",0.8);
}
function CLOSEPOP(id){
$('#Popup'+id).html('');
$('#Popup'+id).fadeOut(300);
$('#mask').fadeOut(300);
}
//if mask is clicked
$('#mask').click(function () {
$(this).fadeOut(300);
$('.VPopWin').fadeOut(300);
});
これが HTML onclick と div です。
<td class="BroadcastText" onClick="POPUP('Popup',1)">Broadcast 1 Message</td>
<div id="Popup1" class="VPopWin">
ポップアップ機能は機能しますが、[Broadcast 1 Message] をクリックすると、ボックスには div id のみが表示されます。この場合は 1 です。div id="Popup2" をクリックすると 2 が表示されます。私はIDの代わりに持っていますか?