$('iframe').css('visibility','hidden')在谷歌浏览器中不起作用 [英] $('iframe').css('visibility','hidden') not working in google chrome
问题描述
$('ul li')。find('iframe')。css({ '可见性': '可见'});
极好的在Firefox和Opera中,
控制台错误:
不安全的JavaScript尝试访问带有URL文件的帧:/// D:/ Configuracion / Documents%20and%20Settings / TNMC000 / Escritorio /player/roundabout/js/round1.htm,网址为 http://www.youtube.com/embed / hurnoKLuBD8 的。域名,协议和端口必须匹配。
测试网址: http://toniweb.us/vimeo-like/js/images.htm
有什么想法吗? p>
-EDIT -
我使用
.invisible {text-indent:-9999px}
和
< div class =iframe>< iframe>< / iframe>< / div>
和
$('ul li')。find('。iframe')。addClass('invisible');
但是仍然想知道如何解决它只能使用iframe
实际上使iframes不可见(即使用 visibility:hidden
或显示:无
)。
但是你可以通过足够小的方法让它们消失
$('ul li')。find('iframe ').css({height:0,width:0,border:none});
I am using something like
$('ul li').find('iframe').css({'visibility':'visible'});
wich works fine In Firefox and Opera,
console error:
Unsafe JavaScript attempt to access frame with URL file:///D:/Configuracion/Documents%20and%20Settings/TNMC000/Escritorio/player/roundabout/js/round1.htm from frame with URL http://www.youtube.com/embed/hurnoKLuBD8. Domains, protocols and ports must match.
Test URL: http://toniweb.us/vimeo-like/js/images.htm
any idea?
-EDIT-
I fixed it using
.invisible{ text-indent:-9999px }
and
<div class="iframe"><iframe></iframe></div>
and
$('ul li').find('.iframe').addClass('invisible');
But still would like to know how to fix it working with only the iframe
There are issues with actually making iframes invisible (i.e. using visibility:hidden
or display:none
).
But you can make them disappear by being small enough
$('ul li').find('iframe').css({"height":"0", "width":"0", "border":"none"});
这篇关于$('iframe').css('visibility','hidden')在谷歌浏览器中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!