posted 18 years ago
OK, I missed that you were trying to do this after loading, which, of course, is a different story than what I first answered.
I'm not certain which you want to do, add styles to the iframe itself or to the contents of the iframe. Either is possible and both would require the use of JavaScript.
If you want to add/change the style of the iframe itself, that is easy enough to do by calling a JavaScript function that would get the DOM element for the iframe, by calling the document object's getElementById() passing it the iframe's id (you can also call getElementByName() and pass it the name of the iframe, but I prefer id). e.g.: var oIFrame = document.getElementById(iframeid) . Then set the style, for example, border-color with oIFrame.style.border-color="#FF0000";
The same goes for elements of the document inside the iframe, but with the added complication that you after getting the iframe DOM element, you need to drill down into it to get the document.
[ April 10, 2006: Message edited by: Linda Walters ]
<a href="http://labryssystems.net/pblog/index.php" target="_blank" rel="nofollow">Javaville Gazette</a><br />Non-cooperation with evil is a duty. -- Mahatma Gandhi