Hide div in iframe

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm
Location: Roma, Italy

Hide div in iframe

Post 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
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: Hide div in iframe

Post 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.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
Post Reply

Return to “The Lounge”