2013-03-12 79 views
2

我有一個問題,從最新的基金軌道的定製。從the docs基金會4 - 自定義軌道

軌道選項只能在這個時候初始化期間傳遞英寸

{ 
    timer_speed: 10000, 
    animation_speed: 500, 
    bullets: true, 
    stack_on_small: true, 
    container_class: 'orbit-container', 
    stack_on_small_class: 'orbit-stack-on-small', 
    next_class: 'orbit-next', 
    prev_class: 'orbit-prev', 
    timer_container_class: 'orbit-timer', 
    timer_paused_class: 'paused', 
    timer_progress_class: 'orbit-progress', 
    slides_container_class: 'orbit-slides-container', 
    bullets_container_class: 'orbit-bullets', 
    bullets_active_class: 'active', 
    slide_number_class: 'orbit-slide-number', 
    caption_class: 'orbit-caption', 
    active_slide_class: 'active', 
    orbit_transition_class: 'orbit-transitioning' 
} 

姆姆,太棒了。但如何應用它?我試過

$('#slider').orbit({...}); 
--- 

$(document).foundation().orbit({...}); 

但是沒什麼效果。我知道這很愚蠢,但怎麼做呢?

回答

1
$(document).foundation('orbit', {bullets:false}); 
+0

請解釋爲什麼** **,可以解決這個問題。 – fuxia 2013-03-12 19:09:43

+0

嗨。它運作良好,但我怎麼能同時使用'$(文件).foundation()'(一切)和'$(文件).foundation( '功能',{}')'的設置? – 2013-03-13 19:01:05

+0

我相信,當你調用的基礎性作用,其他所有方法都載入默認選項,只有指定的人將被覆蓋。 – chaoskreator 2013-04-17 00:25:00

2

「從4.0.7開始,您還可以使用data-options屬性將配置設置傳遞給Orbit。」 來源:foundation.zurb.com/docs/components/orbit.html

把它像一個樣式屬性:

<ul data-orbit data-options="timer_speed:2500; bullets:false;"> 
    ... 
</ul>