views:

33

answers:

1

hi there, I have a iframe that loads into out page that causes a display issue. We've tried CSS changes although it still causes a problem. Is there anyway to hide an iframe using jquery that is loaded externally.

we've tried the document ready but it looks like the external js file that it uses also has the document ready method so when we try on our code to wait for the call to finish (with the document ready) it does work.

thanks,

+2  A: 

Are there any other IFRAMES on the page that need to be viewed?

If not, could you just add some CSS?:

IFRAME { display: none; }
Fosco
this didnt work. is there a jquery event that works? the following didnt work $('iframe').css('display','none');
JamesRadford
Probably this is the best way to go. Where or when the iframe is loaded doesn't mind, it won't show up :) See this in a [live example](http://www.jsfiddle.net/u3dJf/) on a jsFiddle I made
Justus Romijn
when using jQuery, you are better off with `$("iframe").hide();`
Justus Romijn
@JamesRadford we're not able to re-produce this issue... there must be some information we are missing that you could provide.
Fosco
@Justus I believe the difference in processing time would be insignificant, but in what possible way could the jQuery way be 'better' than outright excluding it with CSS?
Fosco
Who on earth would want to use jQuery for this?
Pekka
maybe I've mislead you, we have an external javascript reference in our html. Its this reference that generates an iframe on our page.
JamesRadford
@JamesRadford I understand, but the CSS rule should always hide the iframe, it doesn't matter how the iframe is loaded.
Justus Romijn