[英]Rails Foundation Orbit is not a function
I'm trying zurb foundation framework for the first time. 我第一次尝试使用zurb基础框架。 I would like to create a slideshow; 我想创建一个幻灯片; however, I receive type error orbit is not a function. 但是,我收到类型错误轨道不是函数。
This is my application.js file: 这是我的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();
});
Here is my application.css file: 这是我的application.css文件:
*= require active_admin
*= require dcsmt
*= require foundation_and_overrides
*= require style
*= require the-tooltip
*= require jquery.ui.all
*= require_self
Here's what the html/code looks like: 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>
Please advise. 请指教。
Update: 更新:
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
If you run into this problem using the rails gem follow this article: 如果您使用rails gem遇到此问题,请遵循以下文章:
http://foundation.zurb.com/docs/components/orbit.html http://foundation.zurb.com/docs/components/orbit.html
You simple have to add data-orbit to your html: 您只需要将数据轨道添加到html中:
<div data-orbit>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.