gpt4 book ai didi

javascript - 页面加载时的 jQuery Fancybox,iFrame 中的内容

转载 作者:行者123 更新时间:2023-12-03 12:01:07 27 4
gpt4 key购买 nike

我想在文档准备好时加载 fancybox,但在特定的 DIV 中,fancybox 的内容将来自不同的页面,显示为 iFrame。这是我目前拥有的:

$(document).ready(function () {     
$.fancybox({
'href' : "#div",
'content' : "content.jsp",
'type' : "iframe",
});
});

HTML:

<div id="div">
</div>

没有加载任何内容。

最佳答案

试试这个:

$(document).ready(function () {     
$("#div").fancybox({
'href' : 'content.jsp',
'type' : 'iframe'
});
});

HTML

<div id="div">
Click Here
</div>

JsFiddle

关于javascript - 页面加载时的 jQuery Fancybox,iFrame 中的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25410365/

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