gpt4 book ai didi

fancybox - 添加动态 html 到花式框

转载 作者:行者123 更新时间:2023-12-02 08:57:29 24 4
gpt4 key购买 nike

一直在使用 FancyBox 来显示 swf 播放器。我想做的是有一个 if 语句,当 false 将 flash 变量添加到 'swf': {...} 时,我正在工作。当 true 时显示一些内联标记。

if (true) {
$.fancybox({
'type': inline
//can I ref markup here???
});
} else {
$.fancybox({
'href' : somepath,
'type': 'swf',
'swf': {..}
});
}

是否有人能够建议我如何使用上述方法引用标记。或者如果我什至可以在这里添加动态 html,这将是一个更好的方法。

提前致谢

艾迪

最佳答案

解决了这个问题。

我需要使用关键内容,这会强制FancyBox加载html内容:

if(true){
var content = $('#someHtml').html();
$.fancybox({
'content': content,
'padding' : 20
});
}else{...}

关于fancybox - 添加动态 html 到花式框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3877282/

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