0
不幸的是,我在本地主機上使用Joomla,無法提供網頁鏈接。JQuery Accordion擾亂其他頁面定位功能
我有一個網頁,通過使用平滑滾動瀏覽錨鏈接。
菜單固定在左,利用簡單的
<a href="#wrapper">top</a>
<a href="#section1">section1</a>
<a href="#section2">section2</a>
<a href="#section3">section3</a>
當我激活任何jQuery的手風琴擴展到任何部分出現我的問題。 (我已經下載並嘗試所有)
如果我在第1節中放置手風琴,除第2節& 3之外的所有頁面跳轉均不起作用。
如果我在第2節中放置手風琴,第3節的頁錨不起作用。
我試圖刪除返回false;不得要領:
jQuery(document).ready(function() {
//Set default open/close settings
jQuery('.xac-container').hide(); //Hide/close all containers
jQuery('.xac-trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
//On Click
jQuery('.xac-trigger').click(function(){
if(jQuery(this).next().is(':hidden')) { //If immediate next container is closed...
jQuery('.xac-trigger').removeClass('active').next().slideUp(); //Remove all "active" state and slide up the immediate next container
jQuery(this).toggleClass('active').next().slideDown(); //Add "active" state to clicked trigger and slide down the immediate next container
}
else{
jQuery('.xac-trigger').removeClass('active');
jQuery(this).next().slideUp();
}
// return false; //Prevent the browser jump to the link anchor
});
});
我看到一些CSS教程,使手風琴,但它創造點擊每個手風琴項目pagejumps,並不必要添加到瀏覽器的歷史記錄。
我希望我已經夠清楚了。這似乎是一個普遍的問題,但我漫長的搜索沒有結果。
我假設模塊嵌入了JQuery的副本,但您的模板是否也使用JQuery?使用Firebug等瀏覽器擴展,查看是否正在加載兩個JQuery文件。 – Lodder 2012-07-18 21:05:08
你是絕對的天才!我有來自smoothscrool,lightbox和手風琴的3個不同的jQuery庫。刪除了其中兩個,一切都很完美!救命稻草 – user1535933 2012-07-19 09:26:15