在我的網頁我有此鏈接:發送的ID使用JavaScript
<\a onclick="#" class="compose"></a>
通過點擊該鏈接,這個腳本被激活:
$(function(){
$('.compose').click(function() { // Button which will activate our modal
$('#popup_bestanden_edit_name').reveal({ // The item which will be opened with reveal
animation: 'fade', // fade, fadeAndPop, none
animationspeed: 600, // how fast animtions are
closeonbackgroundclick: true, // if you click background will modal close?
dismissmodalclass: 'close' // the class of a button or element that will close an open modal
});
return false;
});
});
上面的腳本將會使這個div可見,至極是一個彈出:
<div id="popup_bestanden_edit_name">
<div id="popupheading">
Naam wijzigen
</div>
<div id="popupcontent">
<p><form action="" method="post" name="naamwijzigen"><input name="naam" type="text"></form></p>
<a href="#" class="popupbutton green close"><img src="<?php echo $domein.'/images/confirm_popup/tick.png'; ?>">Ja, wijzigen</a>
<a href="#" class="popupbutton red close"><img src="<?php echo $domein.'/images/confirm_popup/cross.png'; ?>">Nee, annuleren</a>
</div>
打開的彈出窗口使人們有機會在網站上編輯文檔的名稱。 所以當鏈接<\a onclick="#" class="compose"></a>
被點擊時,它必須發送一個id($fetch_row['id']
)到彈出窗口,所以我可以在進一步的腳本中使用它。
有誰知道如何做到這一點?
這一個我明白,但是當我用你的腳本替換,然後點擊鏈接,彈出窗口不會再打開。 –
更新: 當我把上面打開dismissModalClass,彈出窗口出現,但我不能通過單擊取消按鈕關閉它。 然後沒有任何事情發生。 –
有一個錯誤,打開之前缺少一個逗號。它被糾正。 – Salim