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 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Location
    San Diego, CA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Using a cell as a link in JavaScript

    Without using images, is there a way (in JavaScript obviously) to use an entire cell as a "clickable" link, instead of JUST the text link within the cell?

    Thanks

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Last edited by adios; 07-03-2002 at 06:55 PM.

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Location
    San Diego, CA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you know what the method is for a link though? That link just has an example for changing the color of the cell (this.bgColor). I am trying to use the cell as a link, as well as the text within it.

    Thanks

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Hmm....

    onclick="window.location='URL'">

  • #5
    New to the CF scene
    Join Date
    Jul 2002
    Location
    San Diego, CA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, well I hope I'm not missing something, because it doesn't seem to be working. Here is the small code for the cell:

    <td bgcolor="#999999" onMouseOut="this.style.backgroundColor=' ';" onMouseOver="this.style.backgroundColor='#999999';" onClick="window.location='contact.html';">
    <a class="hdr" href="contact.html">Contact</a></td>

    Anything wrong jump out at you?

    Thanks

  • #6
    New to the CF scene
    Join Date
    Jul 2002
    Location
    San Diego, CA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please disregard the accidental semi-colons at the end of each JavaScript method...they've been removed.

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    No jumping. A few stylistic alterations:

    <td style="cursor:hand;"
    onmouseout="this.style.background=''"
    onmouseover="this.style.background='#999999'"
    onclick="window.location='contact.html'">
    <a class="hdr" href="contact.html">Contact</a></td>

  • #8
    New to the CF scene
    Join Date
    Jul 2002
    Location
    San Diego, CA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, it works!

  • #9
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="contact.html"



    Probably Gecko-only though, unless Amaya supports simple XLinks.


  •  

    Posting Permissions

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