0

I would like, when the user click on image in the open popup, the content will changed with url in iframe (not close/open, but crossfade)

I have a gallery with hs.transitions = ['expand', 'crossfade'].

Next construction will close old popup window and open new one (and break the slideshow), but i want the same effect (crossfade), like a user click next image.

hs.allowMultipleInstances = false;
hs.Expander.prototype.onImageClick = function()
{
    return hs.htmlExpand(null, { objectType: 'iframe', src: 'url' });
};

How to make it?

Sample - http://jsfiddle.net/xCnfE/4/

4

1 回答 1

1

如果 HTML 弹出窗口不是图库的一部分,则不能从图像交叉淡入淡出到 HTML 弹出窗口。相反,您可以使用 jQuery 创建一个覆盖图像的常规 iframe,并仅在单击图像 ( onImageClick) 时显示此 iframe。请参阅http://jsfiddle.net/roadrash/B7sDG/

hs.Expander.prototype.onImageClick = function (sender) {
    $('<iframe src="'+this.custom.url+'" frameborder="0"></iframe>').css({
        position: 'absolute',
        top: '0',
        height: '100%',
        width: '100%',
        background: '#fff',
        zIndex: 20
    }).appendTo(sender.wrapper);
    return false;
};


使用hs.custom传递url给iframe :srconclick

<a href="large-image.jpg" class="highslide" onclick="return hs.expand(this, galleryOptions, {url: 'http://highslide.com/'})">
    <img src="thumbnail.jpg" alt="Caption Text" />
</a>
于 2013-04-27T13:12:03.973 回答