2012-07-12 24 views

回答

3

該flexslider有一個選項startAt,它接受您的幻燈片索引的整數值。

0

這可以用CoffeeScript中的一點點來完成(或者JS如果你喜歡更多),但只適用於桌面設備至今

# Add support for hashtags 
$(window).load -> 
    # Get your hash tag 
    loc = $(location).attr('href') 
    idx = 1 
    if(loc.lastIndexOf('#') != -1) 
    idx = loc.substr(loc.lastIndexOf('#')+1).replace('slide', '') 
    # verify that idx is really a number 
    if(isNaN(idx-0)) 
    idx = 1 
    # Click on your nav (idx starts at 0) 
    $('.flex-control-nav li:eq('+(idx-1)+') a').trigger('click')