2016-09-28 103 views

回答

1

就發表評論或刪除此行:如果你想改變

$(this).toggleClass('.trigger-expand').css('display', ''); 

現在當瀏覽器大小發生變化並且大於時出現一些css使用這種方法。

$(window).on('resize', function(){ 
     var win = $(this); //this = window 
     if (win.width() > 600) { 
     /* The window is larger than 600px 
      change you css style here */ 
     } 
}); 
0

這將工作

$('#trigger').click(function() { 
    $('#nav-menu').slideToggle(400, function() { 
     //$(this).toggleClass('.trigger-expand').css('display', ''); 
    }); 
    }); 
+0

但是,當我將屏幕恢復爲全寬時,ul不會出現。 – kenny

+0

你的菜單正在工作。你現在想要什麼,我沒有明白你的觀點。 –