SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
Thread: Table cells as links
-
Dec 25, 2002, 21:52 #1
- Join Date
- Dec 2002
- Posts
- 8
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Table cells as links
Hi,
I'm new here but this seems THE best forum for learning on.
Basically my question is this.
I have a table which when you rollover it changes CSS and roll out it changes back. I would like the entire cell to link on click.
The code for it so far is as below.
<td class="Style1" onMouseOver="this.className='Style2';" onMouseOut="this.className='Style1';" onClick="document.open='1233.html';"
i'm not sure whats wrong lol. Its just a test page thus the test link and styles.
If someone could put the entire cell code in which'll work i'd really appreciate it.
Cheers guysone-x
"Simplicity is the key to all things great"
-
Dec 25, 2002, 23:19 #2
- Join Date
- Nov 2002
- Posts
- 51
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
this line is wrong...
document.open='1233.html';
if you want the link to open in a new window use...
Code:onclick="window.open('somepage.html');"
Code:onclick="location.href='somepage.html';"
travis
-
Jan 3, 2003, 09:16 #3
- Join Date
- Jul 2002
- Location
- Dallas, TX
- Posts
- 2,900
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm not sure of your intentions with this, but I'd advise against using this for any website application. Search engines cannot spider links made this way, nor can users with javascript disabled navigate them.
Might I suggest an article for you to read?
-
Jan 3, 2003, 17:01 #4
- Join Date
- Dec 2002
- Posts
- 8
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks but i'm not at all bothered about my site being subjected to a search by any search engine. Also, anyone who has Javascript disabled is one strange person. There's not one person I know who has it disabled unless they are a complete security freak but hey.
Thanks anyway.one-x
"Simplicity is the key to all things great"
-
Jan 3, 2003, 17:27 #5Originally posted by one-x
Thanks but i'm not at all bothered about my site being subjected to a search by any search engine. Also, anyone who has Javascript disabled is one strange person. There's not one person I know who has it disabled unless they are a complete security freak but hey.
Thanks anyway.
--Vinnie
-
Jan 3, 2003, 19:09 #6
- Join Date
- Dec 2002
- Posts
- 8
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thats a good reason for disabling Javascript but I use a browser which blocks popups automatically (and it actually blocks all popup adverts) and to make it even better, its basically Internet Explorer inside, so it supports everything and there's the option to have all browsing windows within this program or to have them as normal when using Internet Explorer.
one-x
"Simplicity is the key to all things great"
-
Jan 9, 2003, 16:22 #7
- Join Date
- Aug 2001
- Location
- Indianapolis, IN
- Posts
- 104
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
what about doing it this way?
Code:<html> <head> <style type="text/css"> .Style1 { width: 150px; height: 25px; background: #CC6600;} .Style2 { width: 150px; height: 25px; background: #CC0000;} </style> </head> <body> <table> <tr> <td class="Style1" onMouseOver="this.className='Style2';" onMouseOut="this.className='Style1';" onClick="window.location.href='?page=News';"><a href="?page=News">Some File</a></td> </tr> </table> </body> </html>
Steve v3.2.2 running on LocalSuck port 80
-
Jan 9, 2003, 20:10 #8
- Join Date
- Apr 2002
- Location
- New Zealand
- Posts
- 8
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You could even do it entirely with CSS:
Code:.link-button { display: block; width: 150px; height: 25px; background: #CC6600; } .link-button:hover { display: block; width: 150px; height: 25px; background: #CC0000; }
Code:<a href="1233.html" class="link-button">Link text</a>
Abhishek
Bookmarks