JSSOR输出字幕不会触发

JSSOR Out Captions wont trigger

本文关键字:输出 字幕 JSSOR      更新时间:2023-09-26

我使用以下代码来显示JSSOR滑块。

滑块本身工作得很好,PlayIn字幕也是如此,但我无法使PlayOut过渡正常工作。

我正在尝试实现与此网站类似的功能,以便在幻灯片更改之前退出标题。

http://goo.gl/7dAXt

这是我的脚本

<script type="text/javascript" src="jssor.core.js"></script>
<script type="text/javascript" src="jssor.utils.js"></script>
<script type="text/javascript" src="jssor.slider.js"></script>
<script>
    jQuery(document).ready(function ($) {
        var _CaptionTransitions = [];
        _CaptionTransitions["transition_name1"] = {$Duration:900,$FlyDirection:1,$Easing:{$Left:$JssorEasing$.$EaseInOutSine},$ScaleHorizontal:0.6,$Opacity:2};
        _CaptionTransitions["transition_name2"] = {$Duration:1500,$Rotate:-1,$FlyDirection:5,$Easing:$JssorEasing$.$EaseLinear,$ScaleHorizontal:0.5,$ScaleVertical:0.5,$Opacity:2,$During:{$Left:[0,0.33],$Top:[0.67,0.33],$Rotate:[0,0.33]},$Round:{$Rotate:0.25}};            
            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: 1,                                //[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
            },
            $CaptionSliderOptions: {
            $Class: $JssorCaptionSlider$,
            $CaptionTransitions: _CaptionTransitions,
            $PlayInMode: 1,
            $PlayOutMode: 3
        },
            };
            var jssor_slider1 = new $JssorSlider$('slider1_container', options);

这是我的HTML

    <!-- 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: #fff; 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: 200px;height:200px;">
        </div>
    </div>
    <!-- Slides Container -->
    <div u="slides" style="cursor: default; position: absolute; left: 0px; top: 0px; width: 960px; height: 385px;
        overflow: hidden;">
                    <!--SLIDE ONE-->
                    <div>
                    <img u="image" src="../images/data-center-servers.jpg" />
                            <div u="caption" t="NO" t2="transition_name2" style="position: absolute; top: 30px; left: 375px; width: 500px;height: 50px;">
                            <h1>Any HTML Content Here</h1>
                            <a href="../virtualisation.html" class="button">Click Here</a>
                            </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>              
                    <!--SLIDE TWO-->
                    <div>
                    <img u="image" src="../images/clouds.jpg" />
                            <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 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>
                    <!--SLIDE THREE-->
                    <div>
                    <img u="image" src="../images/collaboration.jpg" />
                            <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 u="thumb">
                    <div class="title_back">
                    </div>
                    <div class="title">
                    Collaboration
                    <img src="../images/collaboration-icon.png" alt="Collaboration" class="collaborationicon">
                    </div>
                    </div>
                    </div>              
                    <!--SLIDE FOUR-->
                    <div>
                    <img u="image" src="../images/fingerprint.jpg" />
                            <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 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>
                    <!--SLIDE FIVE-->
                    <div>
                    <img u="image" src="../images/fire.jpg" />
                            <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 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>              
                    <!--SLIDE SIX-->
                    <div>
                    <img u="image" src="../images/network.jpg" />
                            <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 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>
               </div> <!--END of u slides-->
        <!-- Trigger -->
        <script>jssor_slider1('slider1_container');</script>
    <!--Slider Navigation Buttons-->
    <!-- ThumbnailNavigator Skin Begin -->
    <div u="thumbnavigator" class="jssort12" style="cursor: pointer; position: absolute; width: 203px; height: 360px; left:128px; 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 -->
</div> <!--END CONTAINER-->

这是我的开发网站的URL。

http://goo.gl/WDkWD1

目前,我根本无法让退出字幕发挥作用。我已经尝试了$PlayOutMode:3和1

非常感谢您的帮助。

我认为这是右括号后的最后一个逗号

     $CaptionSliderOptions: { blah blah $PlayOutMode: 3},  see that comma to the left there. 

我认为删除它是因为我认为代码正在寻找另一个参数,如箭头选项或子弹选项。查看他们演示的源代码可以清楚地看到,在响应内容之前没有逗号。。。。应该以如下方式结束。

    }
      };
     var jssor_slider1 = new $JssorSlider$('slider1_container', options);