- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 JSSOR 为带字幕的幻灯片构建了以下代码。
但是由于某种原因,所有字幕同时触发。
我希望发生的是每次我点击幻灯片然后触发相关的字幕。
更详细地解释什么。如果我单击第一张幻灯片,然后快速转到第二张幻灯片,我会看到幻灯片 2 标题过渡的结尾。但它似乎只在页面加载时触发一次。我希望它在选择幻灯片时运行。
这是我的 JSSOR 代码
jQuery(document).ready(function ($) {
var nestedSliders = [];
var _CaptionTransitions = [];
_CaptionTransitions["transition_name1"] = {$Duration:350,$FlyDirection:3,$Easing:{$Left:$JssorEasing$.$EaseInOutSine},$ScaleHorizontal:0.6,$Opacity:2};
_CaptionTransitions["transition_name2"] = {$Duration: 1000, $FlyDirection: 1, $Easing: $JssorEasing$.$EaseOutCubic }
$.each(["sliderh1_container", "sliderh2_container", "sliderh3_container","sliderh4_container", "sliderh5_container", "sliderh6_container"], function (index, containerId) {
var nestedSliderOptions = {
$PauseOnHover: 0, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, default value is 1
$SlideDuration: 500, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
$MinDragOffsetToSlide: 20, //[Optional] Minimum drag offset to trigger slide , default value is 20
//$SlideWidth: 200, //[Optional] Width of every slide in pixels, default value is width of 'slides' container
//$SlideHeight: 150, //[Optional] Height of every slide in pixels, default value is height of 'slides' container
$SlideSpacing: 3, //[Optional] Space between each slide in pixels, default value is 0
$DisplayPieces: 1, //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1
$ParkingPosition: 0, //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0.
$UISearchMode: 0, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc).
$BulletNavigatorOptions: { //[Optional] Options to specify and enable navigator or not
$Class: $JssorBulletNavigator$, //[Required] Class to create navigator instance
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
$AutoCenter: 0, //[Optional] Auto center navigator in parent container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 0
$Steps: 1, //[Optional] Steps to go for each navigation request, default value is 1
$Lanes: 1, //[Optional] Specify lanes to arrange items, default value is 1
$SpacingX: 10, //[Optional] Horizontal space between each item in pixel, default value is 0
$SpacingY: 0, //[Optional] Vertical space between each item in pixel, default value is 0
$Orientation: 1 //[Optional] The orientation of the navigator, 1 horizontal, 2 vertical, default value is 1
},
$CaptionSliderOptions: {
$Class: $JssorCaptionSlider$,
$CaptionTransitions: _CaptionTransitions,
$PlayInMode: 1,
$PlayOutMode: 3
},
};
nestedSliders.push(new $JssorSlider$(containerId, nestedSliderOptions));
});
var options = {
$AutoPlay: false, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
$AutoPlaySteps: 1, //[Optional] Steps to go for each navigation request (this options applys only when slideshow disabled), the default value is 1
$AutoPlayInterval: 2000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
$PauseOnHover: 0, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, default value is 1
$ArrowKeyNavigation: true, //[Optional] Allows keyboard (arrow key) navigation or not, default value is false
$SlideDuration: 300, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
$MinDragOffsetToSlide: 80, //[Optional] Minimum drag offset to trigger slide , default value is 20
//$SlideWidth: 600, //[Optional] Width of every slide in pixels, default value is width of 'slides' container
//$SlideHeight: 150, //[Optional] Height of every slide in pixels, default value is height of 'slides' container
$SlideSpacing: 3, //[Optional] Space between each slide in pixels, default value is 0
$DisplayPieces: 1, //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1
$ParkingPosition: 0, //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0.
$UISearchMode: 0, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc).
$PlayOrientation: 1, //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, default value is 1
$DragOrientation: 0, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0),
$ThumbnailNavigatorOptions: {
$Class: $JssorThumbnailNavigator$, //[Required] Class to create thumbnail navigator instance
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
$ActionMode: 1, //[Optional] 0 None, 1 act by click, 2 act by mouse hover, 3 both, default value is 1
$AutoCenter: 0, //[Optional] Auto center thumbnail items in the thumbnail navigator container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 3
$Lanes: 1, //[Optional] Specify lanes to arrange thumbnails, default value is 1
$SpacingX: 0, //[Optional] Horizontal space between each thumbnail in pixel, default value is 0
$SpacingY: 0, //[Optional] Vertical space between each thumbnail in pixel, default value is 0
$DisplayPieces: 6, //[Optional] Number of pieces to display, default value is 1
$ParkingPosition: 0, //[Optional] The offset position to park thumbnail
$Orientation: 2, //[Optional] Orientation to arrange thumbnails, 1 horizental, 2 vertical, default value is 1
$DisableDrag: false //[Optional] Disable drag or not, default value is false
}
};
var jssor_slider1 = new $JssorSlider$("slider1_container", options);
function OnMainSliderPark(currentIndex, fromIndex) {
$.each(nestedSliders, function (index, nestedSlider) {
nestedSlider.$Pause();
});
setTimeout(function () {
nestedSliders[currentIndex].$Play();
}, 2000);
}
...这是我的 HTML
<!-- Jssor Slider Begin -->
<!-- You can move inline styles to css file or css block. -->
<div id="slider1_container" style="position: relative; top: 0px; left: 0px; width: 960px; height: 385px; overflow: hidden; ">
<!-- Loading Screen -->
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
<div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;">
</div>
<div style="position: absolute; display: block; background: url(../img/loading.gif) no-repeat center center;
top: 0px; left: 0px;width: 100%;height:100%;">
</div>
</div>
<!-- Slides Container -->
<div u="slides" style="cursor: default; position: absolute; left: 0px; top: 0px; width: 960px; height: 385px;
overflow: hidden;">
<div>
<div id="sliderh1_container" class="sliderh1" style="position: relative; top: 0px; left: 0px; width: 960px;
height: 400px;">
<!-- Slides Container -->
<div u="slides" style="cursor: default; position: absolute; left: 0px; top: 0px; width: 960px; height: 385px;
overflow: hidden;">
<div>
<a href="../virtualisation.html"><img u="image" src="../images/data-center-servers.jpg" /></a>
<div u="caption" t="transition_name1" style="position: absolute; top: 30px; left: 375px; width: 500px;height: 50px;">
<h1>Any HTML Content Here</h1>
</div>
</div>
</div>
<!-- Bullet Navigator Skin Begin -->
<!-- bullet navigator container -->
<div u="navigator" class="jssorb03" style="position: absolute; bottom: 120x; right: 10px;">
<!-- bullet navigator item prototype -->
<div u="prototype" style="position: absolute; width: 0px; height: 0px; text-align:center; line-height:21px; color:white; font-size:12px;"><NumberTemplate></NumberTemplate></div>
</div>
<!-- Bullet Navigator Skin End -->
</div>
<div u="thumb">
<div class="title_back"></div>
<div class="title">
Virtualisation
<img src="../images/virtualisation-icon.png" alt="Virtual Infrastructure" class="virtualicon">
</div>
</div>
</div>
<div>
<div id="sliderh2_container" class="sliderh2" style="position: relative; top: 0px; left: 0px; width: 960px;
height: 400px;">
<!-- Slides Container -->
<div u="slides" style="cursor: default; position: absolute; left: 0px; top: 0px; width: 960px; height: 400px;
overflow: hidden;">
<div><img u="image" src="../images/clouds.jpg" />
<div u="caption" t="transition_name2" style="position: absolute; top: 30px; left: 375px; width: 500px;height: 50px;">
<h1>Any HTML Content Here</h1>
</div>
</div>
</div>
<!-- Bullet Navigator Skin Begin -->
<!-- bullet navigator container -->
<div u="navigator" class="jssorb03" style="position: absolute; bottom: 110px; right: 10px;">
<!-- bullet navigator item prototype -->
<div u="prototype" style="position: absolute; width: 0px; height: 0px; text-align:center; line-height:21px; color:white; font-size:12px;"><NumberTemplate></NumberTemplate></div>
</div>
<!-- Bullet Navigator Skin End -->
</div>
<div u="thumb">
<div class="title_back"></div>
<div class="title">
Cloud and Hosting
<img src="../images/cloud-icon.png" alt="Cloud and Hosting" class="cloudicon">
</div>
</div>
</div>
<div>
<div id="sliderh3_container" class="sliderh3" style="position: relative; top: 0px; left: 0px; width: 960px;
height: 400px;">
<!-- Slides Container -->
<div u="slides" style="cursor: default; position: absolute; left: 0px; top: 0px; width: 960px; height: 400px;
overflow: hidden;">
<div><img u="image" src="../images/collaboration.jpg" /></div>
</div>
<!-- Bullet Navigator Skin Begin -->
<!-- bullet navigator container -->
<div u="navigator" class="jssorb03" style="position: absolute; bottom: 110px; right: 10px;">
<!-- bullet navigator item prototype -->
<div u="prototype" style="position: absolute; width: 0px; height: 0px; text-align:center; line-height:21px; color:white; font-size:12px;"><NumberTemplate></NumberTemplate></div>
</div>
<!-- Bullet Navigator Skin End -->
</div>
<div u="thumb">
<div class="title_back"></div>
<div class="title">
Collaboration
<img src="../images/collaboration-icon.png" alt="Collaboration" class="collaborationicon">
</div>
</div>
</div>
<div>
<div id="sliderh4_container" class="sliderh4" style="position: relative; top: 0px; left: 0px; width: 960px;
height: 400px;">
<!-- Slides Container -->
<div u="slides" style="cursor: default; position: absolute; left: 0px; top: 0px; width: 960px; height: 400px;
overflow: hidden;">
<div><img u="image" src="../images/fingerprint.jpg" /></div>
</div>
<!-- Bullet Navigator Skin Begin -->
<!-- bullet navigator container -->
<div u="navigator" class="jssorb03" style="position: absolute; bottom: 110px; right: 10px;">
<!-- bullet navigator item prototype -->
<div u="prototype" style="position: absolute; width: 0px; height: 0px; text-align:center; line-height:21px; color:white; font-size:12px;"><NumberTemplate></NumberTemplate></div>
</div>
<!-- Bullet Navigator Skin End -->
</div>
<div u="thumb">
<div class="title_back"></div>
<div class="title">
Cyber Security
<img src="../images/security-icon.png" alt="Cyber Security" class="securityicon">
</div>
</div>
</div>
<div>
<div id="sliderh5_container" class="sliderh5" style="position: relative; top: 0px; left: 0px; width: 960px;
height: 400px;">
<!-- Slides Container -->
<div u="slides" style="cursor: default; position: absolute; left: 0px; top: 0px; width: 960px; height: 400px;
overflow: hidden;">
<div><img u="image" src="../images/fire.jpg" /></div>
</div>
<!-- Bullet Navigator Skin Begin -->
<!-- bullet navigator container -->
<div u="navigator" class="jssorb03" style="position: absolute; bottom: 110px; right: 10px;">
<!-- bullet navigator item prototype -->
<div u="prototype" style="position: absolute; width: 0px; height: 0px; text-align:center; line-height:21px; color:white; font-size:12px;"><NumberTemplate></NumberTemplate></div>
</div>
<!-- Bullet Navigator Skin End -->
</div>
<div u="thumb">
<div class="title_back"></div>
<div class="title">
Disaster Recovery
<img src="../images/dr-icon.png" alt="Disaster Recovery" class="dricon">
</div>
</div>
</div>
<div>
<div id="sliderh6_container" class="sliderh6" style="position: relative; top: 0px; left: 0px; width: 960px;
height: 400px;">
<!-- Slides Container -->
<div u="slides" style="cursor: default; position: absolute; left: 0px; top: 0px; width: 960px; height: 400px;
overflow: hidden;">
<div><img u="image" src="../images/network.jpg" /></div>
</div>
<!-- Bullet Navigator Skin Begin -->
<!-- bullet navigator container -->
<div u="navigator" class="jssorb03" style="position: absolute; bottom: 110px; right: 10px;">
<!-- bullet navigator item prototype -->
<div u="prototype" style="position: absolute; width: 0; height: 0px; text-align:center; line-height:21px; color:white; font-size:12px;"><NumberTemplate></NumberTemplate></div>
</div>
<!-- Bullet Navigator Skin End -->
</div>
<div u="thumb">
<div class="title_back"></div>
<div class="title">
Managed Networks
<img src="../images/networking-icon.png" alt="Managed Networks" class="networkingicon">
</div>
</div>
</div>
<!-- Trigger -->
<script>jssor_slider1('slider1_container');</script>
</div>
<!--Slider Navigation Buttons-->
<!-- ThumbnailNavigator Skin Begin -->
<div u="thumbnavigator" class="jssort12" style="cursor: pointer; position: absolute; width: 203px; height: 360px; left:114px; top: 0px;">
<!-- Thumbnail Item Skin Begin -->
<div u="slides" style="cursor: pointer;">
<div u="prototype" class=p style="POSITION: absolute; WIDTH: 203px; HEIGHT: 60px; TOP: 0; LEFT: 0;">
<thumbnailtemplate style="WIDTH: 203px; HEIGHT: 60px; border: none; position: absolute; TOP: 0; LEFT: 0; "></thumbnailtemplate>
</div>
</div>
<!-- Thumbnail Item Skin End -->
</div>
<!-- ThumbnailNavigator Skin End -->
<a style="display: none" href="http://www.jssor.com">slideshow html</a>
</div>
</div>
我的开发站点,可以在这里找到 http://goo.gl/WDkWD1
非常感谢任何帮助。
最佳答案
干得好,恭喜!
我注意到您在主 slider 中管理 6 个子 slider 。每个子 slider 只有 1 张幻灯片。子 slider 没有机会切换幻灯片,你知道字幕动画会在幻灯片切换时开始。
因此,实现目标的方法是,制作一个包含 6 张幻灯片的 slider 并将 $AutoPlay 设置为 false,将 $DragOrientation 设置为 0。
关于javascript - 所有幻灯片的 JSSOR 字幕同时触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25759017/
我正在学习WidgetMarqueeLabel课: #include "WidgetMarqueeLabel.h" #include #include WidgetMarqueeLabel::Wi
我需要使用 Graphviz DOT 打印大量图表。为了区分每个图对应的输入,我还希望每个图都有一个标题。有没有办法将它嵌入到图形的 DOT 表示中。 最佳答案 您可以使用 label为图表添加标题。
我用 jQuery 编写了一个简单的脚本,允许根据 .hover 触发器弹出和弹出标题。 问题是您必须将鼠标悬停在图像上,移回图像上,然后再次将鼠标悬停在图像上才能正常工作。 (你可以在这里明白我的意
我已经成功地将视频转换到 chromecast 现在我正在尝试添加对字幕的支持,这里我面临两个问题 当我使用 NanoHttpd 流式传输 vtt 文件时,chromecast 返回错误代码 2100
我想知道 HTML 选框是否允许在控件(或容器)的开头使用静态文本,以便当文本向左滑动时它会滑动传递文本? 例如。 我正在查看要静态对齐到左侧的日期,数据库中的文本将滑过它,然后从右侧重新出现。 HT
如何在ExoPlayer2上设置字幕?我试过这个 tu bild MergingMediaSource: SingleSampleMediaSource singleSampleSource
我正在使用 FFMPEG 使用如下命令刻录字幕: ffmpeg -i video.mp4 -vf "subtitles=subs.srt:force_style='Fontsize=24,Primar
我有一个输入文件,它基本上是一个 .ts 文件,其中包含 4 个 dvb 字幕流(嵌入其中)。我正在使用以下命令在输出视频中保留 dvb 字幕。 ffmpeg -i Input.ts -c:a cop
假设我想查找副标题中包含“法国总统选举”一词的视频列表。 我可以使用 YouTube API 做到这一点吗? 如果它甚至可以在人工生成和自动生成的字幕中搜索,那将是完美的。但是如果它可以搜索两种类型的
我正在尝试将 YouTube 视频嵌入 YouTube iframe。 视频有一个 yt:cc=on 标签,这意味着默认情况下会加载字幕。 (即使用户不想要,属性 cc_load_policy=1 也
我正在使用 ggplot2 来改进降水条形图。 这是我想要实现的可重现示例: library(ggplot2) library(gridExtra) secu <- seq(1, 16, by=2)
我正在尝试从外部 url 播放电影的字幕,但它不起作用,当我尝试添加本地存储的 vtt 文件时,它就起作用了。下面是代码 上面的代码不起作用。但是当我复制 vtt 的内容时它起作用了。 请
我有一个包含单元格的表格,其中只有在搜索了某些内容后才会出现副标题。这是 cellForRowAtIndexPath 的代码: - (UITableViewCell *)tableView:(UITa
不确定这是不是该问的地方,但我在其他地方运气不好,之前经常通过查看其他人在本网站上的问题和答案来设法找到问题的答案。 我最近安装了一个 WordPress 插件 (WP Subtitle),它允许我为
我正在使用 ActionBarSherlock 字幕并尝试使用样式更改字幕文本大小,但似乎不起作用。我对主题不太熟悉,所以..我该如何更改?? 提前致谢 最佳答案 @style/Widget
跑马灯动画不行,这是我做的。 它适用于第一个 TextView ,但不适用于第二个。我究竟做错了什么? 最佳答案 这对我
如何以编程方式获取正在播放的 YouTube 视频的字幕? 最初我尝试通过 YouTube API 离线进行, 但是 as it seems YouTube 禁止获取您不是所有者的视频的字幕。 现在我
由于 AVPlayer 渲染的隐藏式字幕有时会与其他 UI 组件重叠,我想在单独的 View 中渲染 cc。 我可以通过将 closedCaptionDisplayEnabled 设置为 NO 来关闭
这有点与 Does YouTube API forbid to download video captions if you are not it's owner? 重复的问题, Get YouTub
因此,我尝试使用默认的 chrome 发送器应用程序为 chromecast 设置隐藏式字幕,根据文档,这应该是可能的,as seen here 。我不明白为什么我的代码不起作用。它与提供的示例代码几
我是一名优秀的程序员,十分优秀!