将标题转换为链接在Lightbox 2.51中不起作用 [英] turning caption into a link doesn't work in Lightbox 2.51

查看:158
本文介绍了将标题转换为链接在Lightbox 2.51中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将标题转换为链接在从此处下载的Lightbox 2.51中无法使用


以下是代码:

Turning a caption into a link doesn't work in Lightbox 2.51 downloaded from here
Here is the code:

<a href="images/examples/image-1.jpg" rel="lightbox" 
  title="&lt;a target='_self' href='http://www.google.com'&gt;Google&lt;/a&gt;">
  <img src="images/examples/thumb-1.jpg" alt="" />
</a>

我该怎么办?

谢谢:)

What should I do?
Thanks :)

推荐答案

我在 lightbox.js 中找到了解决此问题的方法。
您必须编辑 if 情况,添加 else 条件,避免始终返回 false 当您点击 div 灯箱时。

I found a solution for this problem in the lightbox.js. You must edit the if case, adding the else condition that avoid always return false when you click in the div "lightbox" .

 $lightbox.hide().on('click', function(e) {
    if ($(e.target).attr('id') === 'lightbox') { 
        _this.end();
        return false;
    }
    else { // HERE
        return true; 
    }
  });

这篇关于将标题转换为链接在Lightbox 2.51中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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