using javascript to alter css of iframe div

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jun 2004
Posts: 247
Reputation: cmills83 is an unknown quantity at this point 
Solved Threads: 1
cmills83 cmills83 is offline Offline
Posting Whiz in Training

using javascript to alter css of iframe div

 
0
  #1
Nov 3rd, 2008
hi

i have a parent window with an external url iframe. when the parent loads i want to set the iframe footer to display:none;. is there a way to do this? i have looked all over w/no luck.

thanks
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 24
Reputation: sasankasekhar is an unknown quantity at this point 
Solved Threads: 3
sasankasekhar's Avatar
sasankasekhar sasankasekhar is offline Offline
Newbie Poster

Re: using javascript to alter css of iframe div

 
0
  #2
Nov 11th, 2008
Originally Posted by cmills83 View Post
hi

i have a parent window with an external url iframe. when the parent loads i want to set the iframe footer to display:none;. is there a way to do this? i have looked all over w/no luck.

thanks

I hope this should solve your problem:

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <script language="JavaScript">
  2. function changeCSS(){
  3. frame = window.document.frames[0];
  4. frame.document.getElementById("myDiv").style.background="red";//OR ..style.display="none";
  5. }
  6. </script>
  7. <a href="javascript:changeCSS()">Click Here here to Change Iframe CSS</a>
  8. <br>
  9. <iframe src="frame.htm" name="myFrame" id="myFrame"></iframe>

frame.htm should have a div tag with the ID as "myDiv".

Regards.
Last edited by sasankasekhar; Nov 11th, 2008 at 3:25 am. Reason: Comments left out
IF SOMEONE FEELS THAT THEY HAD NEVER MADE A MISTAKE IN THEIR LIFE, THEN  IT MEANS THEY HAD NEVER TRIED A NEW THING IN THEIR LIFE
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC