(re)naming an iframe

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Angelo

    (re)naming an iframe

    I'm trying to use iframe to create a menu for a bunch of pages - only
    I'd like the menu to change slightly (a highlight) depending on what
    page it's being displayed in.

    <iframe name="menu" src="menu.html" >

    I think I can use javascript to change the name attribute of the
    iframe, and then have menu.html display that info.

    so lets say bali.html loads the iframe with menu.html. I'd then like
    bali.html to change the name attribute of the iframe to "bali", and
    then have menu display something slightly different on that basis. The
    last part I can do, but I can't find anything that tells me how to
    change the name attribute of the iframe. Can anyone help with this?

    Thanks
    Michael
  • Randy Webb

    #2
    Re: (re)naming an iframe

    Angelo wrote:
    [color=blue]
    > I'm trying to use iframe to create a menu for a bunch of pages - only
    > I'd like the menu to change slightly (a highlight) depending on what
    > page it's being displayed in.
    >
    > <iframe name="menu" src="menu.html" >
    >
    > I think I can use javascript to change the name attribute of the
    > iframe, and then have menu.html display that info.
    >
    > so lets say bali.html loads the iframe with menu.html. I'd then like
    > bali.html to change the name attribute of the iframe to "bali", and
    > then have menu display something slightly different on that basis. The
    > last part I can do, but I can't find anything that tells me how to
    > change the name attribute of the iframe. Can anyone help with this?[/color]

    have bali.html set a variable in the menu.html:

    loadedPage = 'bali.html';

    or:

    menuToUse = 'bali';

    And then act on that variable instead of the IFrame's name attribute.

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javas cript FAQ - http://jibbering.com/faq/

    Comment

    Working...