我正在尝试使用我在这个问题中找到的脚本在 Foundation 3 中运行 Orbit,但我无法让它正确初始化。我在页脚中添加了这个脚本,在页眉中添加了 Foundation.min.js。我在控制台的第 3 行收到 no method 'foundation' 错误,它不起作用。
问问题
584 次
1 回答
5
您链接到的那个 SO 线程中的脚本对您不起作用,因为它使用 Foundation 4。Orbit 在 Foundation 3 (F3) 中以不同方式初始化。所以假设你有一个 id 元素orbitX
。你像这样初始化它:
$("#orbitX").orbit();
在您问的另一个 SO 问题中
您会在哪里添加其他设置?
当你像这样初始化你的轨道元素时你会这样做:
$("#orbitX").orbit({
bullets: false; // to hide the bullets
});
这是完整的选项集
$('#orbitX').orbit({
animation: 'fade', // fade, horizontal-slide, vertical-slide, horizontal-push
animationSpeed: 800, // how fast animtions are
timer: true, // true or false to have the timer
resetTimerOnClick: false, // true resets the timer instead of pausing slideshow progress
advanceSpeed: 4000, // if timer is enabled, time between transitions
pauseOnHover: false, // if you hover pauses the slider
startClockOnMouseOut: false, // if clock should start on MouseOut
startClockOnMouseOutAfter: 1000, // how long after MouseOut should the timer start again
directionalNav: true, // manual advancing directional navs
captions: true, // do you want captions?
captionAnimation: 'fade', // fade, slideOpen, none
captionAnimationSpeed: 800, // if so how quickly should they animate in
bullets: false, // true or false to activate the bullet navigation
bulletThumbs: false, // thumbnails for the bullets
bulletThumbLocation: '', // location from this file where thumbs will be
afterSlideChange: function(){}, // empty function
fluid: true // or set a aspect ratio for content slides (ex: '4x3')
});
于 2013-04-13T05:15:59.977 回答