Bootstrap 3 Carousel字幕延迟
Bootstrap 3 Carousel Caption Delay
网站:http://freedomcreativesolutions.com/old/steamsource/
问题:试图将javascript slide.bs.carousel实现到代码中,使标题延迟并在幻灯片中加载图片后几秒钟出现。我输入了"slide.bs"的代码。Carousel '在结束主体标记之前的script标记中,而不是在单独的js文件中。但它似乎根本不工作,仍然随着图片出现。
我做了什么:http://jsfiddle.net/fuhs3smx/
似乎它在Jsfiddle(这个程序的新手)中不起作用,这就是为什么我给了网站的链接,所以你们至少知道我想要完成什么。
猜猜我在这里想问的是,我到底应该把'slide.bs.carousel'的脚本放在哪里?在我看来一切都很好,我猜是我把脚本放在了错误的地方。
<div id="carousel-example-generic" class="carousel slide carousel-fade" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="./img/family-new.jpg" alt="We are Serious about Clean!">
<div class="carousel-caption">
<h3>Safe for the whole family!</h3>
</div>
</div>
<div class="item">
<img src="./img/RugCleaningFacility.jpg" alt="Rug Cleaning">
<div class="carousel-caption">
<h3>State of the art rug cleaning facility!</h3>
</div>
</div>
<div class="item">
<img src="./img/ProfessionalWW.jpg" alt="Window Washing and Pressure Washing">
<div class="carousel-caption">
<h3>Professional Window Washing and Pressure Washing!</h3>
</div>
</div>
<div class="item">
<img src="./img/UpholsteryClean.jpg" alt="Upholstery Cleaning">
<div class="carousel-caption">
<h3>The deepest upholstery cleaning available!</h3>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" 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="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
更新:在包括bootstrap.min.js之后,我在启动开发工具时得到这个消息:
Uncaught TypeError: undefined is not a function
carouselContainer.carousel({
interval: slideInterval,
cycle: true,
pause: "hover"
}).on('slid.bs.carousel', function() {
toggleCaption();
});
那是什么意思?也许我拼错了什么,或者位置完全错了。
您的小提琴没有包含Bootstrap.js。你还必须包含jQuery,因为Bootstrap.js需要jQuery。
Uncaught TypeError: jQuery.easing[this.easing] is not a function
问题可以通过添加jQuery UI来解决。
你会注意到我也把你的JS放在.ready()
中,这样它就可以保证在DOM准备好后执行。
我已经更新了小提琴供你复习。http://jsfiddle.net/yongchuc/fuhs3smx/2/
- 可以简化嵌套的延迟Q Promises解析吗
- onclick函数需要双击,因为类分配延迟
- 更多延迟动画
- 对父作用域的指令更新延迟了一步
- 为JS函数添加延迟
- 带有延迟的循环每次应运行5次
- 关键帧之间的css3动画延迟
- 如何在有延迟的情况下对两个代码进行积分
- 如何为.css状态的更改添加延迟
- Angular.js延迟控制器初始化
- 在延迟时设置Whois脚本
- 如何在Javascript中延迟setInterval
- 如何在一个元素动画之后延迟
- 如何将一个方法延迟到另一个方法首先完成,javascript
- 如何获得字幕显示与zurbs基金会's轨道滑块
- jQuery延迟了ajax调用的循环
- 如何减少在移动网络应用程序上播放声音的延迟
- 如何将GreaseMonkey中的XMLHttpRequest延迟到目标页面加载完成
- Jssor延迟字幕输出
- Bootstrap 3 Carousel字幕延迟