Lightbox 2可以使用图像映射吗? [英] Can Lightbox 2 work with an Image Map?

查看:169
本文介绍了Lightbox 2可以使用图像映射吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Lightbox 2(版本2.51)和图像映射。该网站用于主题公园,公园地图图像有8个区域,每个区域都应有自己的幻灯片。我尝试使用rel =lightbox [group1],但显然rel不适用于area,就像使用a一样。 Lightbox 2论坛页面上的解决方案在这里 http://www.patworx.de/blog/ ?p = 20 并说:

I am trying to use Lightbox 2 (ver 2.51) with an image map. The site is for a theme park, and the park map image has 8 areas, and each area should have its own slideshow. I tried using rel="lightbox[group1]" but apparently "rel" doesn't work with "area" as it does with "a". The solution on the Lightbox 2 forum page is here http://www.patworx.de/blog/?p=20 and says:

解决方法:
但是Prototype仍然能够获得属性:)
所以只是替换

"Workaround: But Prototype is still able to get the attribute :) So just replace

imageLink.rel

with

Element.readAttribute($(imageLink), "rel")

并享受灯箱!

但是,我在lightbox.js文件中找不到imageLink.rel。这个解决方案提到了Lightbox 2.04,所以它现在可能是一个过时的解决方案。有关Lightbox 2最新版本的任何想法?提前致谢。

However, I can't find imageLink.rel in the lightbox.js file. This solution mentions Lightbox 2.04, so it may be an outdated solution now. Any ideas for the latest version of Lightbox 2? Thanks in advance.

编辑:

http://jsfiddle.net/GBpjJ/

推荐答案

我终于回答了我自己的问题,以防其他人感兴趣...我发现这个页面实际上有一些不同的方法来做一个没有area标签的图像地图,这可以让你使用带有锚标签的rel标签图像映射。对我有用的那个是例子2a。希望这可以帮助其他人。

I finally answered my own question, in case anyone else is interested...I found this page that actually has a few different ways to do an image map without the "area" tag, which lets you use the "rel" tag with an anchor tag in an image map. The one that worked for me was example 2a. Hope this can help someone else.

http:/ /www.wickham43.net/imagemaps.php

这篇关于Lightbox 2可以使用图像映射吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆