所以這裏是我卡在(吸吮jQuery)的地方。在一個模式窗口(Bootstrap)中,我有一個按鈕,點擊後會淡出,然後顯示一個隱藏的div。現在,當您關閉該模式窗口時,我希望顯示該按鈕。但是,目前我被卡在總是顯示的文本中,直到我刷新頁面。只是不知道如何顯示按鈕。試圖刷新/顯示一個模式內的開始div
HTML
<div class="modal-body">
<button class="btn-profile" type="button">Show Profile</button>
<div class="profile">
Your Profile
</div>
</div>
JS
$('.profile').hide();
$('.btn-profile').on('click', function(e) {
e.preventDefault();
$('.profile').fadeIn('fast');
$('.btn-profile').hide();
});
要了解,你想的.btn姿態展現出來,只要你關閉模式窗口? 模態內的按鈕? 你可以顯示一些你的標記嗎? –
是的,該按鈕位於模態機身內部。所以,只要你點擊按鈕「.profile」就會顯示。當你關閉模式並重新打開它時,「.btn-profile」會顯示。 – jfrosty