Javascript “引导转盘”的滑动不平滑;“下一步”;但要“顺利”;“以前的”;
我正在使用bootstrap作为我正在帮助的网站的框架。在网站的首页是一个旋转木马。出于某些奇怪的原因,当单击左箭头(上一个)时,旋转木马“滑动”过渡非常平滑;但是,单击右箭头(下一步)时,它似乎变得非常奇怪 我试着在网上以及引导文件(CSS和JS)中查找 我好像什么也找不到。我已经尝试从carousels的bootstrap网站上重新复制代码。不知道怎么了 网址:www.acebac.org 帮助?:这是JQuery代码:Javascript “引导转盘”的滑动不平滑;“下一步”;但要“顺利”;“以前的”;,javascript,html,css,twitter-bootstrap,carousel,Javascript,Html,Css,Twitter Bootstrap,Carousel,我正在使用bootstrap作为我正在帮助的网站的框架。在网站的首页是一个旋转木马。出于某些奇怪的原因,当单击左箭头(上一个)时,旋转木马“滑动”过渡非常平滑;但是,单击右箭头(下一步)时,它似乎变得非常奇怪 我试着在网上以及引导文件(CSS和JS)中查找 我好像什么也找不到。我已经尝试从carousels的bootstrap网站上重新复制代码。不知道怎么了 网址:www.acebac.org 帮助?:这是JQuery代码: var $item = $('.carousel .item')
var $item = $('.carousel .item');
var $wHeight = $(window).height();
$item.eq(0).addClass('active');
$item.height($wHeight);
$item.addClass('full-screen');
$('.carousel img').each(function() {
var $src = $(this).attr('src');
var $color = $(this).attr('data-color');
$(this).parent().css({
'background-image' : 'url(' + $src + ')',
'background-color' : $color
});
$(this).remove();
});
$(window).on('resize', function (){
$wHeight = $(window).height();
$item.height($wHeight);
});
$('.carousel').carousel({
interval: 5000,
pause: "false"
});
HTML代码:
<div id="mycarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#mycarousel" data-slide-to="0" class="active"> </li>
<li data-target="#mycarousel" data-slide-to="1"></li>
<li data-target="#mycarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item">
<img src="img/bg.jpg" data-color="lightblue" alt="First Image">
<div class="carousel-caption">
<h3>First Image</h3>
</div>
</div>
<div class="item">
<img src="img/bg1.jpg" data-color="firebrick" alt="Second Image">
<div class="carousel-caption">
<h3>Second Image</h3>
</div>
</div>
<div class="item">
<img src="img/bg2.jpg" data-color="violet" alt="Third Image">
<div class="carousel-caption">
<h3>Third Image</h3>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#mycarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#mycarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
第一图像
第二图像
第三图像
请参阅演示:最好在问题中发布代码。