滑入引导轮播标题
slide in bootstrap carousel caption
本文关键字:标题 更新时间:2023-09-26
嗨,参考这个答案引导轮播字幕动画我想对 Animate.css.我想在轮播滑动时添加类 fadeInRightBig。如何使用链接中给出的相同答案来执行此操作
var carouselContainer = $('.carousel');
var slideInterval = 5000;
function toggleCaption() {
// $('.carousel-caption').hide();
var caption = carouselContainer.find('.active').find('.carousel-caption');
caption.delay(500).toggleClass('animated fadeInRightBig');
}
carouselContainer.carousel({
interval: slideInterval,
cycle: true,
pause: "hover"
}).on('slid.bs.carousel', function() {
toggleCaption();
});
您可以使用:
$('.carousel-caption').hide();
$('.active .carousel-caption').delay(1500).addClass('rotateInDownLeft').show();
$('.carousel').on('slid.bs.carousel', function() {
$('.carousel-caption').hide();
$('.carousel-caption').removeClass('rotateInDownLeft');
$('.active .carousel-caption').offsetWidth = $('.active .carousel-caption').offsetWidth;
$('.active .carousel-caption').delay(1500).addClass('rotateInDownLeft').show();
});
演示:http://www.bootply.com/36BixvpmOu
CSS/更少
@-webkit-keyframes rotateInDownLeft {
0% {
-webkit-transform-origin: left bottom;
transform-origin: left bottom;
-webkit-transform: rotate3d(0, 0, 1, -45deg);
transform: rotate3d(0, 0, 1, -45deg);
opacity: 0;
}
100% {
-webkit-transform-origin: left bottom;
transform-origin: left bottom;
-webkit-transform: none;
transform: none;
opacity: 1;
}
}
@keyframes rotateInDownLeft {
0% {
-webkit-transform-origin: left bottom;
transform-origin: left bottom;
-webkit-transform: rotate3d(0, 0, 1, -45deg);
transform: rotate3d(0, 0, 1, -45deg);
opacity: 0;
}
100% {
-webkit-transform-origin: left bottom;
transform-origin: left bottom;
-webkit-transform: none;
transform: none;
opacity: 1;
}
}
.rotateInDownLeft {
-webkit-animation-name: rotateInDownLeft;
animation-name: rotateInDownLeft;
-webkit-animation-duration: 0.6s;
animation-duration: 0.6s;
}
另请参阅:http://css-tricks.com/restart-css-animation/
相关文章:
- CSS-如何定位内容数据标题
- 在PHP中使用javascript更改页面标题'if'
- Brightcove获取/显示HTML中的当前视频标题和描述
- React组件-设置页面标题
- jQuery动态更改标题
- HighCharts长标题文本在某些元素上重叠
- 将行添加到具有固定标题的HTML表中
- CKEditor v4:自制插件中对话框的动态标题
- 如何在自动完成时设置属性标题
- 单元格的工具提示或标题不显示超过2000个字符
- 如何从相应的控制器动态更新标题和描述
- 将超链接添加到“;标题“;标记文本
- 为什么我会出现此错误"未捕获引用错误:未定义标题;
- FullCalendar:事件发生时阻止重叠.标题是一样的
- jQuery动画标题滚动
- 如何动态更改dataTablejQuery插件的列标题
- Wordpress标题和子菜单样式对IE的不满
- 正在尝试将标题标记添加到mailto链接,正文中包含URL
- 使用JavaScript将标题文本替换为按钮文本
- 仅对标题标记的一部分使用document.write