【问题标题】:Highslide gallery with two different thumbnails带有两个不同缩略图的 Highslide 画廊
【发布时间】:2012-01-12 00:49:26
【问题描述】:

我正在尝试用 highslide 制作一个画廊。

我有两个缩略图,一个较大但被裁剪的缩略图列在页面上,如果点击会打开大图像,另一个较小的缩略图具有不同的纵横比。

如何配置 highslide 以实际使用不同的图像作为拇指条?

例如,这是标记的一部分:

<a href="highslide/sample-images/picture12.jpg" class="highslide" 
        title="Caption from the anchor's title attribute" 
        onclick="return hs.expand(this, config1 )">
    <img src="highslide/sample-images/picture12.thumb.jpg"  alt=""/>
</a>

链接指向大图,img 显示裁剪后的缩略图。

我能否覆盖一个函数,例如使用两个缩略图:

<a href="highslide/sample-images/picture12.jpg" class="highslide" 
        title="Caption from the anchor's title attribute" 
        onclick="return hs.expand(this, config1 )">
    <img class="thumb" src="highslide/sample-images/picture12.thumb.jpg"  alt=""/>
    <img class="strip" src="highslide/sample-images/picture12.strip.jpg" style="display: none" alt="" />
</a>

【问题讨论】:

    标签: javascript image-gallery


    【解决方案1】:

    其实我前段时间找到了解决办法:

    在highslide api 参考http://highslide.com/ref/ 上有一个函数stripItemFormatter。函数的参数就是你展开的元素(元素)。

    此函数返回的字符串将被解析为html,并用作thumbstrip的一项。

    如果您查看此示例:http://highslide.com/ref/hs.stripItemFormatter,您可以看到它是如何完成的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-20
      • 1970-01-01
      • 1970-01-01
      • 2015-10-24
      • 1970-01-01
      相关资源
      最近更新 更多