Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter Bootstrap carousel doesn't work on older browsers

Per the docs, this should be enough to run Twitter Bootstrap:

<div class="carousel">
  <div class="carousel-inner">
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
  </div>
</div>

$('.carousel').carousel()

I also included jquery.transitions plugin so I assumed it would degrade in older browsers.
Unfortunately, the slides don't move at all in Firefox 3.6. Why?

like image 523
Dan Abramov Avatar asked Dec 22 '22 02:12

Dan Abramov


1 Answers

It looks like you need to add slide class to your carousel for the simple version to work:

<div class="carousel slide">

Sample carousel has it, and there is a check in the code:

if (!$.support.transition && this.$element.hasClass('slide')) {
  this.$element.trigger('slide')
  $active.removeClass('active')
  $next.addClass('active')
  this.sliding = false
  this.$element.trigger('slid')
}

Kind of strange they didn't mention it, though.

like image 53
Dan Abramov Avatar answered Jan 05 '23 15:01

Dan Abramov