2013-04-07 38 views
1

我試圖做一個充分響應佈局..,jQuery的:刪除添加/根據窗口大小

我有下面的代碼根據瀏覽器的大小增加一個功能,但如何刪除插件如果瀏覽器調整大小,是否刪除此插件的影響? (目前,它只有在頁面是在特定的大小裝工作,如果不是它的大小)

$(document).ready(function(){ 
    $(window).resize(function() { 
     if ($(window).width() >= 420) { 
      // Enable the plugin to make the tab functionality... 
      $("#tabs").tabs(); 
     } 
     else { 
     // Code needed to completely disable the tab functionality?? 
     } 
    }); 
}); 

回答

0

你爲什麼不嘗試使用媒體查詢,然後顯示給搶班:無;.

+1

因爲我仍然需要顯示的選項卡的內容,禁用該功能絕對是我需要我害怕。我可能會使用媒體查詢來禁用標籤導航,但就是這樣。 – Codesworth 2013-04-07 13:02:48