【问题标题】:Highslide: Pause HTML Slideshow when Gallery ExpandsHighslide:画廊展开时暂停 HTML 幻灯片
【发布时间】:2013-06-12 09:51:15
【问题描述】:

我创建了一个 HTML 图库,它可以在每个窗口中展开一个图像。
http://mmvirtualtours.com/0002/photos.php

当我以幻灯片形式运行图库时,我希望它在包含的图像展开时暂停。 我正在尝试以下代码:

hs.Expander.prototype.onAfterExpand = function() {  
if (this.contentType == 'html') {  
    this.slideshow.pause();  

因为它会在幻灯片中的每次转换后暂停。我需要将 contentType 更改为什么?或者有更好的方法吗?

谢谢!

【问题讨论】:

    标签: slideshow highslide


    【解决方案1】:

    删除这个:

    hs.Expander.prototype.onAfterExpand = function() {
        if (this.contentType == 'gallery') {
            this.slideshow.pause();
        }
    };
    

    添加这个:

    // Stop slideshow when viewing large image
    function stopSlideshowAndExpand(element, config) {
        var exp = hs.getExpander(element);
        if (exp.slideshow) {
            exp.slideshow.pause();
        }
        return hs.expand(element, config);
    }
    

    更改 highslide-maincontent div 中大图的 onclick:

    <a class='highslide' href='media/01.jpg' onclick="return stopSlideshowAndExpand(this, largeGalleryOptions1 )">
        <img src='media/s01.jpg' alt='' / border="0">
    </a>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-28
      相关资源
      最近更新 更多