0
不確定我真的在使用手風琴小部件,因爲它意味着要使用,但我已自動顯示這些小組,因此網站查看者無需點擊即可查看每個面板。jQuery手風琴自動化面板 - 如何防止頁面滾動?
問題是如果用戶在手風琴循環時向下滾動,頁面會跳回到下一個開始面板。我嘗試了各種各樣的返回錯誤,並嘗試刪除html中的href標籤。
下面是最少的代碼:
<script type="text/javascript">
$(function(){
$("#accordion").accordion({ header: "h3"});
});
itemid=0;
setInterval ("doSomething()", 2000);
function doSomething(){
itemid++;
$("#accordion").accordion("activate" , itemid);
if (itemid==2){itemid=-1};
}
</script>
</head>
<body>
<div id="accordion">
<div>
<h3 style="font-weight:bold;"><a href="#">title1</a></h3>
<div>content1</div>
<div>
<h3 style="font-weight:bold;"><a href="#">title2</a></h3>
<div>content2</div>
</div>
<div>
<h3 style="font-weight:bold;"><a href="#">title3</a></h3>
<div>content3</div>
</div>
</div>
<br />
....
任何人有想法,我來試試呢?
謝謝。
啊,我用Firebug做了一個小測試,你是對的。設置顯示:在視圖外的項目上都沒有使頁面跳轉。 我不得不重新思考。手風琴展示了該網站的精彩內容,每個面板都是一個標題和描述,用於顯示右側的圖像或動畫(使用「更改」方法來選擇圖像等) 看起來不錯(但隨後作爲設計師我會認爲)。 謝謝,xgarb – xgarb 2010-09-03 09:31:42
@xgarb - 它看起來不錯,我不否認,但可能不切實際,你想達到什麼。 – going 2010-09-03 11:05:18