私はこの機能を持っています
JS
$(document).ready(function(){
$(".slidingDiv").hide();
$('.toggle-next-div').click(function(event){
event.preventDefault();
$(this).next().slideToggle();
});
});
HTML
<a href="#" class="toggle-next-div">Map</a>
<div class="slidingDiv">
<strong>Content</strong>
</div>
ここで、div 自体の中に div を非表示にするリンクを追加する必要があります (ポップアップ ウィンドウの「閉じるボタン」が必要です)。
このようにdivを閉じるために同じ関数を使用できないようです
<div class="slidingDiv">
<a href="#" class="toggle-next-div">Close</a>// it doesn't work why?
<strong>Content</strong>
</div>
div内のリンク「閉じる」でウィンドウを閉じるにはどうすればよいですか?