好的.. Fancebox 包含在我的脚本中。
我使用这个 HTML 链接:
<p><a class="fancybox fancybox.iframe" href="https://twitter.com/intent/tweet?source=webclient&text=Hello+world!">twitter</a></p>
<p><a class="fancybox fancybox.iframe" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fwww.example.com">facebook</a></p>
这个 JS 脚本被添加到页面中:
$(function() {
$(".fancybox").fancybox({
maxWidth : 500,
maxHeight : 450,
fitToView : false,
width : '70%',
height : '70%',
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',
type : 'iframe'
});
});
当我点击其中一个链接时,会弹出一个 Fancybox + 目标窗口。
在源代码中我看到:
<div class="fancybox-wrap fancybox-desktop fancybox-type-iframe fancybox-opened" style="width: 830px; height: auto; display: block; position: fixed; top: 85px; left: 417px; opacity: 1;">
<div class="fancybox-skin" style="padding: 15px;">
<div class="fancybox-outer">
<div class="fancybox-inner" style="width: 800px; height: 302px; overflow: auto;">
<iframe class="fancybox-iframe" scrolling="auto" frameborder="0" hspace="0" name="fancybox-frame1337456160882" src="https://twitter.com/intent/tweet?source=webclient&text=Hello+world!">
<html>
<head>
</head>
<body>
</body>
</html>
</iframe>
</div>
</div>
<div class="fancybox-item fancybox-close" title="Close"></div>
</div>
</div>
这意味着 iframe 未填充外部内容。
如何解决这个问题?
最佳答案
Twitter 不允许 iframe。尝试使用另一个网址。
你连这个都做不到,
<html>
<head>
</head>
<body>
<iframe src='https://twitter.com/intent/tweet?source=webclient&text=Hello+world!'></iframe>
</body>
</html>
关于jquery - iframe 未使用 Fancybox v2.0.6 和 jQuery 1.7.2 填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10668373/