Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts

    changing style element via a frame

    www.hollywoodlightweights.com

    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)
    crossrule=document.styleSheets[0].cssRules
    else if (document.styleSheets[0].rules)
    crossrule=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 ?


    thanks,
    devon

  • #2
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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...
    Last edited by devonrs; 07-01-2006 at 06:17 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •