- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
owl-carousel 幻灯片中的元素在动画开始之前显示(fadeInUp 和 zoomIn)。它们不应该在动画之前可见。在第一张幻灯片中它们表现良好,但在第二张幻灯片中,您可以看到它们总是在 css 动画发生之前出现。
检查这个 fiddle :https://jsfiddle.net/6k8agot1/
//Start Hero slider initialize code
$(document).ready(function(){
var heroSlider = $('.owl-carousel');
heroSlider.owlCarousel({
animateOut: 'fadeOut',
animateIn: 'fadeIn',
autoplayTimeout:5000,
autoplayHoverPause: true,
loop: true,
margin: 0,
nav: false,
mouseDrag:false,
touchDrag:true,
pullDrag:false,
freeDrag:false,
dots:true,
autoplay:true,
responsive: {
0: {
items: 1
},
600: {
items: 1
},
1000: {
items: 1
}
}
});
// End Hero slider initialize code
// Start Reactivate css animation every time a slide is loaded
heroSlider.on("changed.owl.carousel", function(event){
// selecting the current active item
var item = event.item.index-2;
// first removing animation for all captions
$('h1, p').removeClass('fadeInUp');
$('a').removeClass('zoomIn');
$('.owl-item').not('.cloned').eq(item).find('h1, p').addClass(' fadeInUp');
$('.owl-item').not('.cloned').eq(item).find('a').addClass(' zoomIn');
})
});
/*Start buttons*/
.btn.btn-default {
display: inline-block;
border:none;
color: #fff;
padding:15px;
border-radius: 38px;
position: relative;
background-color: #4ac8ed;
z-index: 1;
}
.btn.btn-default:after {
position: absolute;
border:none;
content: '';
top: 0;
color:white;
left: 0;
width: 100%;
height: 100%;
border-radius: 38px;
background:#2f7c93;
transition: opacity 0.3s ease-out;
z-index: 2;
opacity: 0;
}
.btn.btn-default:hover:after {
opacity: 1;
}
.btn.btn-default i {
-webkit-transition: .5s; /* For Safari 3.1 to 6.0 */
transition: .3s ease;
position:relative;
padding:0;
margin:0;
vertical-align: middle;
}
.btn.btn-default:hover i {
transform: translateX(5px);
}
.btn.btn-default b, i, span {
position: relative;
z-index: 3;
}
/*End buttons*/
.owl-theme .owl-dots .owl-dot:focus {
outline: none!important;
}
.owl-carousel .owl-item img {
pointer-events: none;
}
.padding_zero {overflow:hidden; }
.centered {
position: absolute;
margin-top:-250px;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
}
.centered span { font-weight:700;}
.fadeInUp {
animation-duration: .8s!important;
animation-delay: .8s;
}
@keyframes zoomIn {
from {
opacity: 0;
transform: scale3d(.3, .3, .3);
}
to {
opacity: 1;
}
}
.zoomIn {
animation-name: zoomIn;
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translate3d(0, 100%, 0);
}
to {
opacity: 1;
transform: none;
}
}
.fadeInUp {
animation-name: fadeInUp;
}
.it1 .zoomIn {
animation-duration: .8s!important;
animation-delay: 1.2s;
}
.it2 .zoomIn {
animation-duration: .8s!important;
animation-delay: 1s;
}
.item1 b { font-size:14px; font-weight:300;}
.item1 h1 {font-size:65px; line-height: 65px;}
.item1 p {font-size: 20px; }
.item2 h1 {font-size: 65px; }
.item2 p { font-size:20px; }
.item2 b {font-size:14px; font-weight:300;}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid padding_zero ">
<div class="row justify-content-center ">
<div class="col-12 col-md-12 ">
<div class="owl-carousel owl-theme ">
<!-- SLIDE 1 -->
<div class="item " >
<img src="http://divcake.com/temp2/images/forest1.jpg" alt="" >
<div class="centered centered1 col-10 col-md-6 col-lg-4 text-center item1 text-white">
<h1 class="animated fadeInUp mr-0 ">Start your project with us!</h1>
<p class="fadeInUp my-1 my-md-4 animated "> - Make your great ideas become reality - <br>We have the solution</p>
<div class="it1">
<a href="index.php" class="btn btn-default px-3 py-1 px-md-4 py-md-2 zoomIn animated"><b> START PROJECT</b> <i class="fas fa-caret-right "></i></a>
</div>
</div>
</div>
<!-- SLIDE 2 -->
<div class="item ">
<img src="http://divcake.com/temp2/images/proba2.jpg" alt="" >
<div class="centered text-center col-10 col-md-6 item2 text-dark ">
<p class="mb-3 " >Lorem ipsum dolor sit amet, consectetur adipisicing.</p>
<h1 >Lorem2 ipsum dolor.</h1>
<div class="it2">
<a href="contact.php" class="btn btn-default px-3 py-1 px-md-4 py-md-2 "><b>CONTACT</b> <i class="fas fa-caret-right "></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
最佳答案
出现您的问题是因为您是在幻灯片转换完成后进行更改。使用“翻译”事件而不是“更改”应该会有所帮助。
尝试改变
heroSlider.on("改变.owl.carousel", function(event){});
到
heroSlider.on("翻译.owl.carousel", function(event){});
同时保持 Owl Carousel 元素中的类一致,第二个轮播元素子项中缺少动画类。
<h1 class="animated mr-0"></h1>
<p class="my-1 my-md-4 animated"></p>
<a class=" animated"></a>
关于javascript - Owl Carousel 幻灯片中的元素在 css 动画发生之前显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57998819/
我用 Slick 创建了一个垂直旋转木马。我对设计进行了一些更改,除了第一个元素在旋转木马的视野中之外,一切都按我想要的方式工作。一次有 4 个项目在我的轮播中可见,但是当第一个元素位于四个项目中的第
例如,此问题主要发生在用户使用速度较慢的互联网或移动设备时。但是,当轮播中的页面内容/图像没有被缓存时,有时也会在更高的速度上看到闪烁。 如果页面加载并呈现第一个元素,所有轮播“幻灯片”就像一个列表一
当 Owl Carousel 在隐藏元素中启动,然后通过触发器显示该元素时,轮播项目的宽度完全错误(直到窗口调整大小): Fiddle (点击红色链接,看到损坏的布局出现,然后调整窗口大小) 这个问题
在构建轮播时,我意识到猫头鹰添加了克隆的重复项。我的猫头鹰配置看起来像这样。我如何阻止这种情况发生。 owlDfe.owlCarousel({ loop: false,
我正在为一家房地产公司开发一个网站,但我在使用 Bootstrap 的 Carousel 控件时遇到了问题。 我的目标是在一行中包含三个不同的列,并且每列中有一个 Carousel。我让它工作,问题是
我需要让我的 bootstrap 3 carousel-caption 占据我的一半 carousel,让 caption background-color 有点透明,并在其中写入一些文本。 所以逻辑
我正在使用引导媒体 slider 轮播。但是,如果项目少于 4 个,它会重复项目。我想每次点击滑动一个项目。 在下面查看我的代码 查询 $(document).ready(function()
关闭。这个问题需要 details or clarity 。它目前不接受答案。 想改进这个问题?添加详细信息并通过 editing this post 澄清问题。 4年前关闭。 社区在 29 天前审查
似乎默认情况下,Owl Carousel 将代表每张幻灯片的点放在旋转木马下方,而不是底部的内部。我发现我可以给它们添加负边距,它们会进入旋转木马,但它们落后于它有效地使它们变得无用。我想不出让它们出
基于本页 codrops 的代码:Codrops article ,我想将产品 slider 添加到 Bootstrap 轮播中。 I have added a codepen here 这是使瓶子动
我使用 React Bootstrap 轮播。指示器按钮未正确对齐,尺寸也不对。有办法解决这个问题吗? http://imgur.com/a/lhxMS
我很难弄清楚如何使用轮播,更具体地说是如何设置当前幻灯片。 这是文档 of the component 这是 fiddle Go First Go Second
Bootstrap 是否支持在 Carousel 中显示网格列或行而不是 carousel-item -s?这个想法是有一个复杂的网格列结构,它们可以像轮播元素一样相互交换。例如,如果我们有以下网格:
我正在使用 angular-ui bootstrap carousel 并想更改带有图像的左右导航链接。似乎在 tpl 中,它们被硬编码为 ‹ 和 › 有没有人对将这些更改为图像而不更改实际的 ang
React Slick 有没有办法在 Carousel 中包含 Carousel? import Slider from "react-slick";
如何用新的替换/重建 owl 轮播 项目? 描述 在许多情况下,例如当您从数据库中获取新数据时,您会在轮播中添加新数据,但在本示例中,我尝试用新数据替换所有项目。 $('.owl-carousel')
我在我的网站中实现了 Owl Carousel 2,我希望能够使用像这样提供的 Jumbpto 帮助程序跳转到特定幻灯片, $('.btnJump').click(function(){ $(
在轮播上开始拖动时,我无法在移动设备上滚动页面。因此,如果轮播占据了移动设备上的所有可见空间 - 向上/向下翻到页面会变得有点棘手...... 我如何禁用这种滚动的“拦截”? 最佳答案 将此 CSS
我在使用 Twitter Bootstrap Carousel 插件上的 .carousel(number) 方法时遇到问题。不知何故我无法让它工作。轮播本身已启动并正在运行,.carousel('n
我知道之前有人问过这个问题,但是相关的帖子在方法上有所不同,而且 fiddle 的例子也被删除了.. 我的情况:我在这里下载了整个 Bootstrap 表单: http://getbootstrap.
我是一名优秀的程序员,十分优秀!