我在 Twitter Bootstrap 中制作了 Carousel,它在除 IE 之外的所有浏览器中都可以正常工作(滑动)。现在,我真的很努力让它在 IE 中工作,如果不滑动,那么至少它可能会淡入/淡出。
这就是我所做的:
$('#myCarouselforsolutions').carousel({
interval: 3000
});
var slideFrom;
var slideTo;
$('#myCarouselforsolutions').on('slide', function(e) {
slideFrom = $(this).find('.active').index();
slideTo = $(e.relatedTarget).index();
if (typeof slideTo == "undefined") {
slideTo = 2;
}
//console.log ("slide To " + slideTo + " and From " + slideFrom);
$('.media-module').removeClass('primary-one-background')
.removeClass('primary-two-background')
.removeClass('primary-three-background')
.removeClass('primary-four-background')
.removeClass('primary-five-background')
.addClass($(solution_list[slideTo]).attr('value'));
});
$("#prev-solution, #next-solution").click(function(e) {
//e.preventDefault();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="module colored home-solutions primary-two-background">
<div id="myCarouselforsolutions" class="carousel slide">
<div class="carousel-inner carousel-inner-at-home">
<div class="content-container">
<h1 id="num-solutions"></h1>
<h2>SOLUTIONS</h2>
<div id="swipe-container-home-solutions">
<div class="item active" id="solutions-slide-dimensions">
<div class="solution-preview" value="primary-two-background">
<a href="/Index/solutions/periscope/">
<h2>Periscope</h2>
</a>
<p>
Improves return on sales through better pricing, promotions, assortment, and performance management</p>
</div>
</div>
<div class="item" id="solutions-slide-dimensions">
<div class="solution-preview" value="primary-five-background">
<a href="/Index/solutions/objective-health/">
<h2>Objective Health</h2>
</a>
<p>Supports community hospitals and small regional systems to improve their cost performance and strategy</p>
</div>
</div>
</div>
</div>
</div>
<a class="arrow arrow-left hidden-phone" href="#myCarouselforsolutions" data-slide="prev"></a>
<a class="arrow arrow-right hidden-phone" href="#myCarouselforsolutions" data-slide="next"></a>
</div>
</div>