推特引导旋转木马幻灯片与js代码
Twitter bootstrap carousel slideshow with js code
我想在一个网站上制作一堆js/css动画的幻灯片。我使用bootstrap作为它的框架。旋转木马听起来像一个内置的功能,在幻灯片中显示幻灯片,但似乎它是为图像。我的是js动画,我发现很难处理它。有没有更好的方法来做它基于bootstrap框架?
这是Carousel在bootstrap:
<!-- Carousel - consult the Twitter Bootstrap docs at
http://twitter.github.com/bootstrap/javascript.html#carousel -->
<div id="this-carousel-id" class="carousel slide"><!-- class of slide for animation -->
<div class="carousel-inner">
<div class="item active"><!-- class of active since it's the first item -->
<img src="http://placehold.it/1200x480" alt="" />
<div class="carousel-caption">
<p>Caption text here</p>
</div>
</div>
<div class="item">
<img src="http://placehold.it/1200x480" alt="" />
<div class="carousel-caption">
<p>Caption text here</p>
</div>
</div>
<div class="item">
<img src="http://placehold.it/1200x480" alt="" />
<div class="carousel-caption">
<p>Caption text here</p>
</div>
</div>
<div class="item">
<img src="http://placehold.it/1200x480" alt="" />
<div class="carousel-caption">
<p>Caption text here</p>
</div>
</div>
</div><!-- /.carousel-inner -->
<!-- Next and Previous controls below
href values must reference the id for this carousel -->
<a class="carousel-control left" href="#this-carousel-id" data-slide="prev">‹</a>
<a class="carousel-control right" href="#this-carousel-id" data-slide="next">›</a>
</div><!-- /.carousel -->
我想做的事情却把事情搞砸了:
您可以使用活动的滑块与$('.carousel').carousel();
和在每个幻灯片上,您可以使用您的js/css效果与
$('.carousel').on('slide.bs.carousel', function () {
// js function etc.
});
例如http://jsbin.com/kekocuha/1,我使用animate css为每个幻灯片的文本动画,你也可以使用你的images js等。
相关文章:
- 为什么indexOf在这个js代码中不起作用
- js代码从jQuery转换为原生代码
- JS代码中的减号
- 谷歌地图Api和JS代码不工作
- HTML 5 和 3.js 代码不会在网页上显示任何内容
- 为什么这个JS代码打印未定义
- JS代码在jsbin中有效,在jsfiddle或Chrome/Safari中无效
- 页面加载后加载简单的JS代码
- 扩展JS代码
- 如何使用js代码转发reactjs路由器
- 用js代码重新定位文本
- 即使被信号处理程序中断,node.js代码也会一直运行到完成吗
- JS代码使IE9和Safari冻结,在Opera中不起作用
- 分析JS代码以在客户端获取cookie
- 改进js代码以删除全局变量和函数
- 对php文件的Ajax调用返回该文件中的JS代码,而不是执行它
- 在单独的上下文中运行 js 代码并访问其全局变量
- 这个 ajax.js 代码有什么问题
- 如何使用 GetValues 使用 Jint 运行 Js 代码
- JS代码有什么问题,让我知道代码是否可以改进