我正在尝试调整Flexslider轮播的动画时间。我可以通过编辑js“animationSpeed:600”来做到这一点。但是,我想在html中编辑此设置。
这方面的一个例子是html中的data-speed =“7000”覆盖。
var carouselSpeed = carouselInstance.attr(“data-speed”)? carouselInstance.attr(“data-speed”):“5000”
我试过动画速度=“600”,但这不起作用。我怎样才能做到这一点?
AUTOSTARS.heroflex = function () {
$('.heroflex').each(function () {
var carouselInstance = $(this);
var carouselAutoplay = carouselInstance.attr("data-autoplay") == 'yes' ? true : false
var carouselSpeed = carouselInstance.attr("data-speed") ? carouselInstance.attr("data-speed") : "5000"
carouselInstance.flexslider({
animation: carouselStyle,
easing: "swing",
slideshow: carouselAutoplay,
slideshowSpeed: carouselSpeed,
animationSpeed: 600,
});
});
}
<div class="hero-slider heroflex flexslider clearfix" data-autoplay="yes" data-pagination="no"
data-arrows="no" data-style="fade" data-speed="7000">
<ul class="slides">
<li class="parallax"
style="background-image:url(<?= Yii::$app->params['cygnus-general-assets'] ?>slider-3.jpg);"></li>
<li class="parallax"
style="background-image:url(<?= Yii::$app->params['cygnus-general-assets'] ?>slider-4.jpg);"></li>
</ul>
</div>
https://github.com/woocommerce/FlexSlider/wiki/FlexSlider-Properties