View Full Version : changing style element via a frame

07-01-2006, 06:00 AM

i have a function that changes the color of different elements within my style sheet. the problem is, even though the page in the iframe references that same style sheet, because the function is being called by the parent page, it only changes items in the parent page, not the frame. i was looking for a line that would affect the element in the frame, something like:

top.framename.crossrule[9].style.backgroundColor = c ;}

(the crossrule bit is a crossbrowser thing that connects with this part of the function:
if (document.styleSheets[0].cssRules)
else if (document.styleSheets[0].rules)

i have tried all kinds of ways of writing that line... to no avail. so then i tried putting the function on the page i'm trying to affect, and calling it from the parent frame, which i could also not get to work... all i can find when i search the web is how to call a function from a child frame to a parent frame, i want to call it from index.html ...so ?


07-01-2006, 06:12 AM
okay, i figured out how to call the function in the frame, so at least makes what i want to do work for now...

still would be nice to figure out how to affect the style in the frame though...