Carousel没有开始循环上传

时间:2012-06-27 12:27:34

标签: javascript jquery html twitter-bootstrap carousel

问题在于标题。

我的HTML:

   <div id="myCarousel" class="carousel">
    <div class="carousel-inner">
      <div class="active item"><%=  image_tag("/images/home_page_1.png")%></div>
      <div class="item"><%= image_tag("/images/home_page_2.png", :size => '600x260') %></div>
      <div class="item"><%= image_tag("/images/home_page_3.png", :size => '600x260') %></div>
    </div>
  </div>

我的js:

$('#myCarousel').carousel({ interval: 200 }) 

文件位于我的js文件夹中。倾向于其他工作赖特。 Google Chrome给我错误:

  

未捕获TypeError:对象[object Object]没有方法'carousel':3000 / assets / application.js?body = 1:17

2 个答案:

答案 0 :(得分:2)

确保:

  • 只加载了一个jQuery。

  • jQuery包含在bootstrap.jsbootstrap-carousel.js

  • 之前
  • 不要同时包含bootstrap.jsbootstrap-carousel.js

答案 1 :(得分:0)

您是否正确加载了jquery carousel扩展程序javascript文件? Jquery默认没有轮播方法,你必须使用像http://thomaslanciaux.pro/jquery/jquery_carousel.htm

这样的扩展名
相关问题