$ ('iframe'). css ('visibility', 'hidden') does not work in google chrome

I use something like

$('ul li').find('iframe').css({'visibility':'visible'}); 

which works great in Firefox and Opera,

Console Error:

An unsafe JavaScript attempt to access a frame with the URL file: /// D: /Configuracion/Documents%20and%20Settings/TNMC000/Escritorio/player/roundabout/js/round1.htm from the frame with the URL http: // www. youtube.com/embed/hurnoKLuBD8 . Domains, protocols, and ports must be consistent.

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 I would like to know how to fix this, working only with iframe

+8
jquery visibility security google-chrome iframe
source share
3 answers

There are problems with making iframes invisible (i.e. use 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"}); 
+3
source share

I know this is a bit outdated, but I ran into the same problem. My decision was

 css( 'opacity', 0 ) 
+6
source share

The feature map should work fine, but if you set only one style, it might be easier to skip the feature map completely. Try the following:

 $('ul li').find('.titThumb').css('visibility', 'visible'); $('ul li').find('.titIframe').css('visibility', 'hidden'); 

http://api.jquery.com/css/

-one
source share

All Articles