【问题标题】:PrettyPhoto Jquery Lightbox link problemsPrettyPhoto Jquery Lightbox 链接问题
【发布时间】:2009-11-19 04:33:45
【问题描述】:

我正在使用神奇的 PrettyPhoto Lightbox,一个 Jquery 灯箱克隆。

要使用 iframe 启动灯箱,这是代码

<a href="http://www.google.com?iframe=true&width=100%&height=100%" rel="prettyPhoto[iframes]" title="Google.com opened at 100%">Google.com</a>

这很好用!

问题是我正在使用 javascript 用这段代码创建一些 div 的链接

<div onclick="http://www.google.com?iframe=true&width=100%&height=100%" rel="prettyPhoto[iframes]" class="menuitem">

不幸的是,这不起作用。我怀疑这是因为 DIV 不支持 rel 属性。有人对如何克服这个有任何想法吗?

感谢您的帮助,

提姆

【问题讨论】:

    标签: jquery lightbox


    【解决方案1】:

    查看插件 js 文件 (jquery.prettyPhoto.js) 的第 87 行

    $('a[rel*='+theGallery+']').each(function(i){
    

    它专门寻找“a”元素。您可以浏览插件并更改一些内容以使其满足您的需求。

    $('div[rel*='+theGallery+']').each(function(i){
    

    我应该补充一点,我认为 rel 不是有效的 div 属性。您可能想要使用一个类或其他一些可选属性。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多