0

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

当我将画廊作为幻灯片放映时,我希望它在包含的图像展开时暂停。我正在尝试以下代码:

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

因为它会在幻灯片中的每次转换后暂停。我需要将 contentType 更改为什么,或者是否有更好的方法来做到这一点?

谢谢!

4

1 回答 1

0

删除这个:

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>
于 2013-06-12T01:51:15.143 回答