2012-08-29 37 views
0

我知道這可能是一個非常簡單和愚蠢的修復,但我找不到答案,這讓我瘋狂。鏈接不工作時使用jQuery的滾動路徑

如果您點擊頂部導航的任何鏈接只是看看http://mozlo.com/zabzie/

,他們就死定了。如果我禁用jquery.scrollpath.js,它按預期工作,但事情是我需要該腳本。任何想法如何解決這個問題?我試了一切我能想到的無濟於事,任何幫助表示讚賞

在此先感謝!

法比奧

+0

我得到' $沒有定義在第15行w母雞我去那頁 – MrOBrian

回答

1

更改此:

// Add scrollTo on click on the navigation anchors 
$("nav").find("a").each(function() { 
    var target = $(this).attr("href").replace("#", ""); 
    $(this).click(function(e) { 
     e.preventDefault(); 

     // Include the jQuery easing plugin (http://gsgd.co.uk/sandbox/jquery/easing/) 
     // for extra easing functions like the one below 
     $.fn.scrollPath("scrollTo", target, 1000, "easeInOutSine"); 
    }); 
}); 

到:

// Add scrollTo on click on the navigation anchors 
$("nav#panelnav").find("a").each(function() { 
    var target = $(this).attr("href").replace("#", ""); 
    $(this).click(function(e) { 
     e.preventDefault(); 

     // Include the jQuery easing plugin (http://gsgd.co.uk/sandbox/jquery/easing/) 
     // for extra easing functions like the one below 
     $.fn.scrollPath("scrollTo", target, 1000, "easeInOutSine"); 
    }); 
}); 

這樣它不影響你的主導航

在demo.js

+0

非常感謝你Sabithpocker!這使它! :) – Devin