Owl 轮播滑块不会在 Rails 应用程序的 Ruby 中显示
Owl Carousel Slider won't Display in Ruby on Rails App
我一直在尝试将 OwlCarousel 图像滑块实现到我的 RoR 应用程序中。问题是滑块似乎没有被调用。
这是它当前输出的内容(有两张图片)-
这是我当前的相关代码-
在application.js
//= require jquery
//= require bootstrap-sprockets
//= require jquery_ujs
//= require turbolinks
//= require owl.carousel
//= require_tree .
在application.css.scss
/*
*= require owl.carousel
*= require owl.theme
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";
在show.html.erb
<div>
<div class="col-xs-12 col-md-offset-2 col-md-6 project-right-panel">
<div id="owl-carousel">
<% @post_attachments.each do |p| %>
<%= image_tag p.avatar_url %>
<%= link_to "Edit Attachment", edit_post_attachment_path(p) %>
<% end %>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#owl-carousel").owlCarousel({
autoPlay: 3000,
item : 3,
itemsDesktop : [1119,3],
itemsDesktopSmall : [979, 3]
});
});
</script>
item : 3
应该是 items: 3
。可能就是这样。他们的演示看起来也希望您将图像包装在 div
和 class item
.
中
我一直在尝试将 OwlCarousel 图像滑块实现到我的 RoR 应用程序中。问题是滑块似乎没有被调用。
这是它当前输出的内容(有两张图片)-
这是我当前的相关代码-
在application.js
//= require jquery
//= require bootstrap-sprockets
//= require jquery_ujs
//= require turbolinks
//= require owl.carousel
//= require_tree .
在application.css.scss
/*
*= require owl.carousel
*= require owl.theme
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";
在show.html.erb
<div>
<div class="col-xs-12 col-md-offset-2 col-md-6 project-right-panel">
<div id="owl-carousel">
<% @post_attachments.each do |p| %>
<%= image_tag p.avatar_url %>
<%= link_to "Edit Attachment", edit_post_attachment_path(p) %>
<% end %>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#owl-carousel").owlCarousel({
autoPlay: 3000,
item : 3,
itemsDesktop : [1119,3],
itemsDesktopSmall : [979, 3]
});
});
</script>
item : 3
应该是 items: 3
。可能就是这样。他们的演示看起来也希望您将图像包装在 div
和 class item
.