2010-03-09 154 views
1

我正在構建一個網站here但鏈接到頁面有問題。這個網站是一個頁面的網站,有menue和一個JavaScript觸發它。不是如果你訪問鏈接,我想將3個綠色框鏈接到level1,level2,level3,就像主菜單一樣。但在如何做到這一點上存在問題。動態jquery選項卡

這裏是頂部菜單

<div class="navi"> 
<a style="display:none"></a> 
<a id="t1">Level 1</a> 
<a id="t2">Level 2</a> 
<a id="t3">Level 3</a> 
<a id="t4">Online Marketing</a> 
<a id="t5">Social Media</a> 
<a id="t6">Contact us</a> 
<a id="t7" class="noBorder">Français</a> 
</div> 

代碼這裏是JavaScript:

<script type="text/javascript"> 
// initialize scrollable and return the programming API 
var api = $("#scroll").scrollable({ 
    items: '#tools', 
    size: 1, 
    clickable: false 

// use the navigator plugin 
}).navigator({api: true}); 


// this callback does the special handling of our "intro page" 
api.onStart(function(e, i) { 

    // when on the first item: hide the intro 
    if (i) { 
     $("#intro").fadeOut("slow"); 

    // otherwise show the intro 
    } else { 
     $("#intro").fadeIn(1000); 
    } 

    // toggle activity for the intro thumbnail 
    $("#t0").toggleClass("active", i == 0); 
}); 

// a dedicated click event for the intro thumbnail 
$("#t0").click(function() { 

    // seek to the beginning (the hidden first item) 
    $("#scroll").scrollable().begin(); 

}); 

</script> 

我怎麼更改或修改,所以我可以得到3個綠色方塊在主頁中的行爲就像1級,2級,3級

回答

1

在您的綠色框上試試這個:

<h2 class="microsite"><a href="" onclick="javascript:api.seekTo(1); return false;">Microsite Website Package</a></h2> 
<h2 class="cms"><a href="" onclick="javascript:api.seekTo(2); return false;">CMS Website Package</a></h2> 
<h2 class="transactional"><a href="" onclick="javascript:api.seekTo(3); return false;">E-commerce Website Package</a></h2> 

注意到我已經刪除了ID的。你永遠不應該在頁面上有一個重複的ID。它可能會破壞事物。

+0

感謝工作像一個魅力.... – 2010-03-09 15:09:00