2010-07-12 115 views
3

我使用這個jQuery的頂部,它的偉大工程 問題是,當我在頁面跳轉一路頂部的按鈕點擊。我使用Miva如果有所作爲JQuery的頁面跳轉到該頁面

$(document).ready(function(){ 
     $('.drop').click(function(){ 
      var $next = $(this).parent().next('li.drop_down'); 
      if($next.is(':visible')) { 
       $next.slideUp(); 
      } else { 
       $next.slideDown(); 
      } 
     }); 
    }); 

回答

10

嘗試在click()函數的末尾添加「return false」。

編輯:(添加的代碼示例)

$(document).ready(function(){ 
     $('.drop').click(function(){ 
      var $next = $(this).parent().next('li.drop_down'); 
      if($next.is(':visible')) { 
       $next.slideUp(); 
      } else { 
       $next.slideDown(); 
      } 

      return false; 
     }); 
    });