Need help with change color of td and link

Discussion in 'Javascript' started by Surajit, Feb 25, 2005.

  1. Surajit

    Surajit Guest

    Hi

    I have written the following code for changing color of the <td> and
    also the text in that <td> on mouseover. I have written it as a
    javascript code and need it that way only.


    write("<table width='100%' cellspacing='0' cellpadding='0' border='0'
    class='colpaleblue'><tr>");

    write("<td width='100%' height='30' align='left' valign='middle'
    onclick='fn_redirect(\"../index.html\");'
    onmouseover='this.className=\"menutexton\";homelink.className=\"menutexton\";window.status=\"Home\";return
    true;' onmouseout='this.className=\"menutextoff\";homelink.className=\"menutextoff\";window.status=\"\";return
    true;'><img src='../images/common/trans.gif' width='10' height='1'><a
    href='../index.html' onmouseover='window.status=\"Home\";return true;'
    onmouseout='window.status=\"\";return true;' class='menutext'
    id='homelink'>Home</a></td>");

    write("</tr></table>");

    This is working fine with IE6+ but in NS7+ it is giving error that
    "homelink is not defined".

    Please let me know where is the issue, if anyone has got any idea
    about this.

    Thanks
    Surajit
     
    Surajit, Feb 25, 2005
    #1
    1. Advertising

  2. Surajit

    RobB Guest

    Surajit wrote:
    > Hi
    >
    > I have written the following code for changing color of the <td> and
    > also the text in that <td> on mouseover. I have written it as a
    > javascript code and need it that way only.
    >
    >
    > write("<table width='100%' cellspacing='0' cellpadding='0' border='0'
    > class='colpaleblue'><tr>");
    >
    > write("<td width='100%' height='30' align='left' valign='middle'
    > onclick='fn_redirect(\"../index.html\");'
    >

    onmouseover='this.className=\"menutexton\";homelink.className=\"menutexton\";window.status=\"Home\";return
    > true;'

    onmouseout='this.className=\"menutextoff\";homelink.className=\"menutextoff\";window.status=\"\";return
    > true;'><img src='../images/common/trans.gif' width='10' height='1'><a
    > href='../index.html' onmouseover='window.status=\"Home\";return

    true;'
    > onmouseout='window.status=\"\";return true;' class='menutext'
    > id='homelink'>Home</a></td>");
    >
    > write("</tr></table>");
    >
    > This is working fine with IE6+ but in NS7+ it is giving error that
    > "homelink is not defined".
    >
    > Please let me know where is the issue, if anyone has got any idea
    > about this.
    >
    > Thanks
    > Surajit


    http://www.jibbering.com/faq/#FAQ4_41
     
    RobB, Feb 25, 2005
    #2
    1. Advertising

  3. Surajit

    Guest

    got the idea
    Thanks :)


    RobB wrote:
    > Surajit wrote:
    > > Hi
    > >
    > > I have written the following code for changing color of the <td>

    and
    > > also the text in that <td> on mouseover. I have written it as a
    > > javascript code and need it that way only.
    > >
    > >
    > > write("<table width='100%' cellspacing='0' cellpadding='0'

    border='0'
    > > class='colpaleblue'><tr>");
    > >
    > > write("<td width='100%' height='30' align='left' valign='middle'
    > > onclick='fn_redirect(\"../index.html\");'
    > >

    >

    onmouseover='this.className=\"menutexton\";homelink.className=\"menutexton\";window.status=\"Home\";return
    > > true;'

    >

    onmouseout='this.className=\"menutextoff\";homelink.className=\"menutextoff\";window.status=\"\";return
    > > true;'><img src='../images/common/trans.gif' width='10'

    height='1'><a
    > > href='../index.html' onmouseover='window.status=\"Home\";return

    > true;'
    > > onmouseout='window.status=\"\";return true;' class='menutext'
    > > id='homelink'>Home</a></td>");
    > >
    > > write("</tr></table>");
    > >
    > > This is working fine with IE6+ but in NS7+ it is giving error that
    > > "homelink is not defined".
    > >
    > > Please let me know where is the issue, if anyone has got any idea
    > > about this.
    > >
    > > Thanks
    > > Surajit

    >
    > http://www.jibbering.com/faq/#FAQ4_41
     
    , Feb 26, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Adams
    Replies:
    0
    Views:
    923
    Matt Adams
    Aug 26, 2003
  2. Hilde Vons

    change (fore)color of link doesn't work

    Hilde Vons, Feb 15, 2006, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    151
    Hilde Vons
    Feb 15, 2006
  3. Kamaljeet Saini
    Replies:
    0
    Views:
    475
    Kamaljeet Saini
    Feb 13, 2009
  4. Replies:
    7
    Views:
    409
    Mick White
    Feb 2, 2005
  5. apparker
    Replies:
    10
    Views:
    387
    apparker
    Apr 3, 2007
Loading...

Share This Page