gpt4 book ai didi

jquery - Fancybox:从事件覆盖中链接到另一个内联 html div

转载 作者:太空宇宙 更新时间:2023-11-04 12:34:17 25 4
gpt4 key购买 nike

在我的主页上,我建立了以下链接:

<a href="#ACCT2251" class="fancybox">ACCT 2251</a>

根据#id 加载以下内联 html 内容:

<div class="pop_up" id="ACCT2251">
<!-- note these divs are hidden by css class -->
.
.
<a href="#ACCT2252">ACCT 2252</a>
</div>

<div class="pop_up" id="ACCT2252">
<!-- note these divs are hidden by css class -->
.
.
<a href="#ACCT2251">ACCT 2253</a>
</div>

那部分工作正常。我遇到的问题是从事件的 fancybox 覆盖链接到另一个内联 html #id。查看上面的示例,您会注意到每个内联 html div 都包含指向另一个内联 html div 的链接。尽管该链接是以与主页链接相同的格式构建的,但它不起作用。关于如何使这项工作有任何想法吗?

提前致谢!

最佳答案

你需要正确调用它

HTML :-

  <a class="fancyTrigger" href="#TheFancybox">hi</a>
<hr>
<div id="TheFancybox">Just adding a paragraph to demonstrate that you can dynamically create HTML content within a DIV using <a class="fancyTrigger1" href="#TheFancybox1">hi</a>
</div>
<div id="TheFancybox1">Just adding a paragraph to demonstrate that you can dynamically create HTML content within a DIV using</div>
Powered by <a href="http://fancybox.net/" target="_blank">Fancybox</a>

CSS :-

/*  Note that the fancybox css file is loaded under the 
"Add Resources" tab to the left. Normally you would load it in your <head> */

body {
background-color: #eef;
}
#TheFancybox,#TheFancybox1 {
display: none;
}

Jquery : -

// Note that the fancybox js file is loaded under the 
// "Add Resources" tab to the left. Normally you would load it in your <head>


$(".fancyTrigger,.fancyTrigger1").fancybox();

可以找到一个演示Here

关于jquery - Fancybox:从事件覆盖中链接到另一个内联 html div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27398185/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com