Page 1 of 1

Hide div in iframe

Posted: Wed Feb 12, 2014 11:42 pm
by nervino
Hello,
I put an iframe in a cmsms page, and tried to hide an iframe's element, like this:

Code: Select all

<__iframe id="webmailiframe" src="https://mycloud.seeweb.it/webmail/" frameborder="0" style="overflow:hidden;height:400px;width:100%" height="400px" width="100%"></__iframe>

{literal}
<__script__>
$('#webmailiframe').contents().find('#menu').hide();
</__script>
{/literal}
but it doesn't work due to the Same-origin policy I guess.

Has anybody a workaround?

thanks

Re: Hide div in iframe

Posted: Thu Feb 13, 2014 2:35 am
by JohnnyB
Yep. Cross domain won't work. If the iframe source originated from your own domain, you could use JS/jQuery to modify it.