2011-02-15 70 views
0

我正在使用jQuery Cycle在一個頁面佈局網站上切換內容。使用#hash/anchor顯示jQuery循環幻燈片,不是數字

目前我已經更改了腳本,以便在URL中顯示當前幻燈片(使收藏夾可以顯示當前幻燈片)。

我也可以提醒正確的ID,但我無法得到它來激活幻燈片功能/效果。

$(window).bind('hashchange', function() { //detect hash change 
     var hash = window.location.hash.slice(1); //hash to string (= "myanchor") 
     alert(hash); //This Alerts the right ID/anchor of the current slide 
     //$('.slideshow').cycle(hash); // This doesn't work. If I use 1, 2, 3 etc. it shows the diffent slides 
    }); 

我該如何得到這個工作?我錯過了什麼嗎?

預先感謝您。

回答