2013-03-12 77 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>