我必须在我的项目中使用简单的内容轮播。使用jquery 2.1.3 ...... 在此之前我使用了jquery内容轮播,但它没有响应,所以我一直在寻找简单的响应式轮播,并找到:Tiny Carousel
现在我把它的.js和.css文件放在Bundles.config中可以看出:
bundles.Add(new ScriptBundle("~/bundles/euro/js").
Include("~/Scripts/euro/*.js", "~/Scripts/euro/jquery.tinycarousel.js"));
bundles.Add(new StyleBundle("~/Content/euro/css").
Include("~/Content/euro/*.css", "~/Content/euro/tinycarousel.css"));
并在视图中
<div id="slider1">
<a class="buttons prev" href="#"><</a>
<div class="viewport">
<ul class="overview">
<li><img src="~/images/contact.png" /></li>
<li><img src="~/images/contact.png" /></li>
<li><img src="~/images/contact.png" /></li>
<li><img src="~/images/contact.png" /></li>
</ul>
</div>
<a class="buttons next" href="#">></a>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('#slider1').tinycarousel();
});
</script>
图片:
问题是“上一页”和“下一页”控件不起作用,而且还没有显示完整图像
可能是旧的/新的jquery问题......请有人帮忙... 或者我可以检查firebug中的脚本或css文件问题吗?
感谢您的时间..
答案 0 :(得分:1)
您可以使用bootstrap carousel对现有的bootstrap模板进行位修改。 Bootstrap移动每个.item
元素,因此只需在每个.item
内放置多个图像,这将为您提供几乎所需的结果。
<强> DEMO 强>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div class="page-header">
<h3>Bootstrap</h3>
<p>Responsive Moving Box Carousel Demo</p>
</div>
<div class="carousel slide" id="myCarousel">
<div class="carousel-inner">
<div class="item active">
<ul class="thumbnails">
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
</ul>
</div><!-- /Slide1 -->
<div class="item">
<ul class="thumbnails">
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
</ul>
</div><!-- /Slide2 -->
<div class="item">
<ul class="thumbnails">
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
</li>
</ul>
</div><!-- /Slide3 -->
</div>
<div class="control-box">
<a data-slide="prev" href="#myCarousel" class="carousel-control left">‹</a>
<a data-slide="next" href="#myCarousel" class="carousel-control right">›</a>
</div><!-- /.control-box -->
</div><!-- /#myCarousel -->
</div><!-- /.span12 -->
</div><!-- /.row -->
</div><!-- /.container -->