gpt4 book ai didi

javascript - Revolution Slider - 如何为不同的项目设置不同的时间?

转载 作者:搜寻专家 更新时间:2023-11-01 04:50:25 27 4
gpt4 key购买 nike

情况:

我的幻灯片放映使用的是 Slider Revolution 插件。
我需要为显示的图像设置不同的时间(持续时间)。例如,第一张图片我只需要显示 2 秒,而第二张图片需要显示 7 秒。

问题:

如何设置单个项目的持续时间?可能吗?

代码:

在初始化插件的js函数中,有这些设置:延迟:9000,并更改它,可以设置持续时间,但会考虑所有项目。

这是js函数:

 initRevolutionSlider: function () {
var tpj=jQuery;

tpj(document).ready(function() {

if (tpj.fn.cssOriginal!=undefined)
tpj.fn.css = tpj.fn.cssOriginal;

var api = tpj('.fullwidthbanner').revolution(
{
delay:9000,
startwidth:960,
startheight:250,

onHoverStop:"off", // Stop Banner Timet at Hover on Slide on/off

thumbWidth:100, // Thumb With and Height and Amount (only if navigation Tyope set to thumb !)
thumbHeight:50,
thumbAmount:3,

hideThumbs:1,
navigationType:"bullet", // bullet, thumb, none
navigationArrows:"solo", // nexttobullets, solo (old name verticalcentered), none

navigationStyle:"round-old", // round,square,navbar,round-old,square-old,navbar-old, or any from the list in the docu (choose between 50+ different item), custom


navigationHAlign:"center", // Vertical Align top,center,bottom
navigationVAlign:"bottom", // Horizontal Align left,center,right
navigationHOffset:30,
navigationVOffset:20,

soloArrowLeftHalign:"left",
soloArrowLeftValign:"center",
soloArrowLeftHOffset:20,
soloArrowLeftVOffset:0,

soloArrowRightHalign:"right",
soloArrowRightValign:"center",
soloArrowRightHOffset:20,
soloArrowRightVOffset:0,

touchenabled:"on", // Enable Swipe Function : on/off


stopAtSlide:-1, // Stop Timer if Slide "x" has been Reached. If stopAfterLoops set to 0, then it stops already in the first Loop at slide X which defined. -1 means do not stop at any slide. stopAfterLoops has no sinn in this case.
stopAfterLoops:-1, // Stop Timer if All slides has been played "x" times. IT will stop at THe slide which is defined via stopAtSlide:x, if set to -1 slide never stop automatic

hideCaptionAtLimit:0, // It Defines if a caption should be shown under a Screen Resolution ( Basod on The Width of Browser)
hideAllCaptionAtLilmit:0, // Hide all The Captions if Width of Browser is less then this value
hideSliderAtLimit:0, // Hide the whole slider, and stop also functions if Width of Browser is less than this value


fullWidth:"on",

shadow:0 //0 = no Shadow, 1,2,3 = 3 Different Art of Shadows - (No Shadow in Fullwidth Version !)

});

这是单个项目的 HTML:

<div class="fullwidthbanner">
<li data-transition="3dcurtain-vertical" data-slotamount="10" data-speed="100" data-masterspeed="300" data-thumb="assets/img/sliders/revolution/thumbs/thumb1.jpg">

<!-- THE MAIN IMAGE IN THE FIRST SLIDE -->
<img src="img/slideshow/1.jpg">

</li>
</div>

在这种情况下,data-speeddata-masterspeed 考虑的是过渡时间,而不是项目持续时间。

也许有人知道这是如何实现的?
它必须在 HTML 中或可能在 js 函数中完成?

非常感谢!

最佳答案

根据此文档 [已删除无效链接],很确定它适用于您的插件,它为每张幻灯片提供了一个 data-delay 配置。

请参阅页面中“02 slider 项”标题下的文档。

<div class="fullwidthbanner">
<li data-transition="3dcurtain-vertical"
data-delay="2000"
data-slotamount="10"
data-speed="100"
data-masterspeed="300"
data-thumb="assets/img/sliders/revolution/thumbs/thumb1.jpg">

<!-- THE MAIN IMAGE IN THE FIRST SLIDE -->
<img src="img/slideshow/1.jpg">
</li>
<li data-transition="3dcurtain-vertical"
data-delay="7000"
data-slotamount="10"
data-speed="100"
data-masterspeed="300"
data-thumb="assets/img/sliders/revolution/thumbs/thumb2.jpg">

<!-- THE MAIN IMAGE IN THE SECOND SLIDE -->
<img src="img/slideshow/2.jpg">
</li>
</div>

关于javascript - Revolution Slider - 如何为不同的项目设置不同的时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22010565/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com