繁体   English   中英

外部链接在fancybox中不起作用

[英]external link not workin in fancybox

fancybox中嵌入的链接有任何设置吗? 我的连结无法运作

HTML

<button href="#show_popup_link" class="show_popup">Click to open Fancybox</button>
<div id="show_popup_link" class="show_popup" style="display: none;">
    Hello, I need this link to work this 
    <a href="http://www.google.com">External Link</a>
</div>

jQuery的

$(document).ready({
    $(".show_popup").fancybox();)
};

Fancybox打开,但该链接似乎不起作用。

jsfiddle链接:
http://jsfiddle.net/n2dHC/7/

删除以下HTML上的class="show_popup"代码:

<div id="show_popup_link" class="show_popup" style="display: none;">

因此,应改为:

<div id="show_popup_link" style="display: none;">

因为您在button元素上定义了相同的类名,所以这会导致fancybox尝试再次打开它,但不能,因为它已经打开。

工作jsFiddle

在给定的示例中,您为链接和分区指定了相同的类名称“ show_popup”。 因此,即使您单击“外部链接”,divide.fancybox(); 正在打电话。 请更改部门名称并尝试。

FIDDLE 请检查小提琴链接。

<div id="show_popup_link" class="show_popup11" style="display: none;">
    Hello, I need this link to work 
    <a href="http://www.google.com" target="_blank">External Link</a>
</div>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM