【发布时间】:2014-07-23 16:40:32
【问题描述】:
我有一个 jQuery fancybox 弹出窗口,效果很好。
假设弹出窗口包含一个链接<a href="http://example.com/foo/bar.html">show another content of this fancybox</a>
当你点击那个链接时,fancybox 弹出框消失,整个浏览器显示http://example.com/foo/bar.html 页面(有道理)。
此解决方案也不起作用:
<a href="#" onclick="alert('we are on the way to change the content of the fancybox');self.parent.location='http://example.com/foo/bar.html';alert('new content should be applied already');return false;">You are clicking on the link in the fancybox to apply a new content to this fancybox</a>
任何建议如何在同一个花式框弹出窗口中用新内容替换旧内容?谢谢。
刚刚添加:似乎我正在使用的一半:
$(".fancybox-inner").load("http://example.com/foo/bar.html");
我是在正确的轨道上还是可以以更好的方式完成? 谢谢。
【问题讨论】:
-
你想要什么?你想在点击时在fancybox上显示锚的内容吗?
-
@Runcorn 对。我想在fancybox中显示example.com/foo/bar.html的内容。包括锚点在内的所有以前的内容都应该被删除。
-
如果你也发布你的 jQuery 代码你会怎么想?
标签: javascript jquery html popup fancybox