【发布时间】:2011-06-25 14:44:05
【问题描述】:
现在我有一个带有无缝属性的 iFrame 对象,看起来很完美,
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.google.com%2F&layout=standard&show_faces=false&width=400&action=like&colorscheme=light&height=35" seamless></iframe>
有几个 css 属性
iframe {
overflow: hidden !important;
border: none !important;
width: 400px;
height: 35px;
background-color: #cce0da;
text-align: right;
padding-left: 20px;
}
然后对于 Internet Explorer,我使用一些 jQuery 应用了一些后备属性
$(function() {
$('iframe', '.ie')
.attr('allowTransparency', 'true')
.attr('frameBorder', '0')
.attr('scrolling', 'no');
});
我最终得到的是 IE 中带有不必要边框的透明 iFrame。
也许我的代码有问题?也许我对 frameBorder 属性的 DOM 操作在 document.ready 之后没有呈现?
【问题讨论】:
标签: jquery dom html cross-browser