View Full Version : Using a cell as a link in JavaScript
dfb78
07-03-2002, 06:40 PM
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
adios
07-03-2002, 06:51 PM
http://www.faqts.com/knowledge_base/view.phtml/aid/979/fid/192
onclick="window.location='URL'">
:cool:
dfb78
07-03-2002, 07:06 PM
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
adios
07-03-2002, 07:09 PM
Hmm....
onclick="window.location='URL'">
dfb78
07-03-2002, 07:26 PM
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
dfb78
07-03-2002, 07:29 PM
Please disregard the accidental semi-colons at the end of each JavaScript method...they've been removed.
adios
07-03-2002, 07:32 PM
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>
dfb78
07-03-2002, 07:40 PM
Thanks, it works!
xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="contact.html"
:D
Probably Gecko-only though, unless Amaya supports simple XLinks.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.