0

slideToggleを使用してプルダウンメニューを作成し、クリックプルダウンメニューにマスクなどの追加の効果を追加しています。プルダウンメニューの背景にモーダルマスクを表示しています。クリックアウト側ではマスクを非表示にしており、プルメニューはトグルして閉じます(プルアップ)。しかし、メニューがトグルしてプルアップしたときに.pullerクラスをクリックしてもマスクを非表示にできませんが、背景マスクは非表示になりません。

$(".puller").click(function() {
    //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').fadeTo("slow",0.6);  
    $(".patientDetail").slideToggle();
 });

 $('#mask').click(function () {
    $(this).fadeTo("fast",0);   
    $(this).hide("fast");
    $(".patientDetail").slideToggle();
 }); 
4

1 に答える 1

0

私はコードを以下のように変更しました

$(".puller").click(function() {
    //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').fadeTo("slow",0.6);  
    $(".patientDetail").slideToggle(function() {
          if($(this).is(":hidden")) {
         alert("this was a slide up");
       } 
     });
 });
于 2011-02-02T12:54:42.607 に答える