【问题标题】:How To Initialize Foundation 3 To Use Orbit?如何初始化 Foundation 3 以使用 Orbit?
【发布时间】:2013-04-12 21:03:08
【问题描述】:

我正在尝试使用在 this question 中找到的脚本在 Foundation 3 中运行 Orbit,但我无法正确初始化它。我在页脚中添加了这个脚本,在页眉中添加了 Foundation.min.js。我在控制台的第 3 行收到 no method 'foundation' 错误,它不起作用。

【问题讨论】:

    标签: jquery zurb-foundation orbit


    【解决方案1】:

    您链接到的那个 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')
    });
    

    【讨论】:

    • 再次感谢您的所有帮助冯。我发现this page 初始化埋在文档中的Foundation 4 的Javascript。你知道 Foundation 3 的类似文件吗?
    • 不客气。 This也许是你想要的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多