0

我是第一次尝试 zurb 基础框架。我想制作幻灯片;但是,我收到的类型错误轨道不是函数。

这是我的 application.js 文件:

 //= require jquery
//= require jquery_ujs
//= require jquery.ui.core
//= require foundation
//= require active_admin
//= require contractor_validate
//= require painter_validate
//= require jquery.social.media.tabs.1.6
//= require jquery.validate.min
//= require payment
//= require the-tooltip
//= require general
//= require_self

$(document).foundation();

$(window).load(function() {
$('#featured').orbit();
});

这是我的 application.css 文件:

  *= require active_admin
  *= require dcsmt
  *= require foundation_and_overrides
  *= require style
  *= require the-tooltip
  *= require jquery.ui.all
  *= require_self

这是 html/代码的样子:

 <div class="large-6 columns">
        <div id="featured">
          <% count = 0 %>
          <% @slides.each do |s| %>
              <% if count == 0 %>
                  <%= image_tag s.slide_photo.url(:medium) %>
              <% else %>
                  <%= image_tag s.slide_photo.url(:medium) %>
              <% end %>
              <% count = count + 1 %>
          <% end %>
        </div>
      </div>

请指教。

更新:

  group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

 # See https://github.com/sstephenson/execjs#readme for more supported runtimes
 # gem 'therubyracer', :platforms => :ruby

 gem 'uglifier', '>= 1.0.3'
 gem 'zurb-foundation', '~> 4.0.0'
 end
4

1 回答 1

0

如果您在使用 rails gem 时遇到此问题,请遵循本文:

http://foundation.zurb.com/docs/components/orbit.html

您只需将数据轨道添加到您的 html 中:

 <div data-orbit>

 </div>
于 2013-03-16T18:15:19.333 回答