![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've got a table (in a frame) like the sample below where the whole cell is click-able. This works well except I'd like the cells to show standard link behavior for the cell text, so if the cell link has been visited the cell text would be a diferent color etc. Any ideas on how to do this? Thanks Eric TABLE id="test" border='0' cellspacing='0' cellpadding='0' TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.top.location='http://home_loc.com'" td>Home</td /TR TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.Window.location='Travels/Travels.html'" td>Our Travels</td /TR /TABLE |
#3
| ||||
| ||||
|
|
I've got a table (in a frame) like the sample below where the whole cell is click-able. This works well except I'd like the cells to show standard link behavior for the cell text, so if the cell link has been visited the cell text would be a diferent color etc. Any ideas on how to do this? |
|
Thanks Eric TABLE id="test" border='0' cellspacing='0' cellpadding='0' TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.top.location='http://home_loc.com'" |
|
td>Home</td /TR TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.Window.location='Travels/Travels.html'" |
|
td>Our Travels</td /TR /TABLE |
#4
| |||
| |||
|
|
Eric wrote: I've got a table (in a frame) like the sample below where the whole cell is click-able. This works well except I'd like the cells to show standard link behavior for the cell text, so if the cell link has been visited the cell text would be a diferent color etc. Any ideas on how to do this? Thanks Eric TABLE id="test" border='0' cellspacing='0' cellpadding='0' TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.top.location='http://home_loc.com'" td>Home</td /TR TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.Window.location='Travels/Travels.html'" td>Our Travels</td /TR /TABLE How about this approach: onclick="parent.document.location.href='http://home_loc.com'" onclick="parent.document.location.href='http://www.google.com'" |
#5
| |||
| |||
|
|
Eric wrote: I've got a table (in a frame) like the sample below where the whole cell is click-able. This works well except I'd like the cells to show standard link behavior for the cell text, so if the cell link has been visited the cell text would be a diferent color etc. Any ideas on how to do this? Thanks Eric TABLE id="test" border='0' cellspacing='0' cellpadding='0' TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.top.location='http://home_loc.com'" td>Home</td /TR TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.Window.location='Travels/Travels.html'" td>Our Travels</td /TR /TABLE How about this approach: onclick="parent.document.location.href='http://home_loc.com'" onclick="parent.document.location.href='http://www.google.com'" !-- Travels/Travels.html -- Mike Well, thanks for answering but i think you missed the point. How is that |
#6
| |||
| |||
|
|
Well, thanks for answering but i think you missed the point. How is that going to fix my problem? Maybe I'm not explaining this well enough. I want the color of the text in between <td> and </td> to change just like if it was a link and not just plain text. ie: if you click on the cell to go to wherever the cell points to the text should change color to the same color as a visited link color would be. |
#7
| |||
| |||
|
|
Mike Scirocco wrote: Eric wrote: I've got a table (in a frame) like the sample below where the whole cell is click-able. This works well except I'd like the cells to show standard link behavior for the cell text, so if the cell link has been visited the cell text would be a diferent color etc. Any ideas on how to do this? Thanks Eric TABLE id="test" border='0' cellspacing='0' cellpadding='0' TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.top.location='http://home_loc.com'" td>Home</td /TR TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.Window.location='Travels/Travels.html'" td>Our Travels</td /TR /TABLE How about this approach: onclick="parent.document.location.href='http://home_loc.com'" onclick="parent.document.location.href='http://www.google.com'" !-- Travels/Travels.html -- Mike Well, thanks for answering but i think you missed the point. How is that going to fix my problem? Maybe I'm not explaining this well enough. I want the color of the text in between <td> and </td> to change just like if it was a link and not just plain text. ie: if you click on the cell to go to wherever the cell points to the text should change color to the same color as a visited link color would be. Eric Keep a status variable for each link. Use onClick to go to a function |
#8
| |||
| |||
|
|
Eric wrote: Mike Scirocco wrote: Eric wrote: I've got a table (in a frame) like the sample below where the whole cell is click-able. This works well except I'd like the cells to show standard link behavior for the cell text, so if the cell link has been visited the cell text would be a diferent color etc. Any ideas on how to do this? Thanks Eric TABLE id="test" border='0' cellspacing='0' cellpadding='0' TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.top.location='http://home_loc.com'" td>Home</td /TR TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.Window.location='Travels/Travels.html'" td>Our Travels</td /TR /TABLE How about this approach: onclick="parent.document.location.href='http://home_loc.com'" onclick="parent.document.location.href='http://www.google.com'" !-- Travels/Travels.html -- Mike Well, thanks for answering but i think you missed the point. How is that going to fix my problem? Maybe I'm not explaining this well enough. I want the color of the text in between <td> and </td> to change just like if it was a link and not just plain text. ie: if you click on the cell to go to wherever the cell points to the text should change color to the same color as a visited link color would be. Eric Keep a status variable for each link. Use onClick to go to a function which changes the state of the variable and changes the CSS for the link (thus changing its colour). Use Ajax to send the new state back to your server. Finally visit the link. When refreshing the page, use the state information to set the starting values for the variable and CSS. Ajax? never heard of it. In any case I wouldnt want to install some new |
#9
| |||
| |||
|
|
Eric said the following on 3/13/2006 6:50 PM: I've got a table (in a frame) like the sample below where the whole cell is click-able. This works well except I'd like the cells to show standard link behavior for the cell text, so if the cell link has been visited the cell text would be a diferent color etc. Any ideas on how to do this? If you want it to behave like a link, use a link. Then the browser does all the work. Short of that, include in the onclick a call to change the CSS class: onclick="this.className = 'clicked'"; Where clicked is a class in CSS that uses underline and color changes to mimick links. style type="text/css" .clicked{ text-decoration: underline; color: #000000; background-color: #FFFFFF; } /style Thanks Eric TABLE id="test" border='0' cellspacing='0' cellpadding='0' TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.top.location='http://home_loc.com'" top isn't a good name for a frame, its going to cause you problems as top is a reserved word in JS. td>Home</td /TR TR onmouseover="this.style.background='#0860a8';this. style.cursor='pointer'" onmouseout="this.style.background='';" onclick="parent.Window.location='Travels/Travels.html'" Do you have a frame window named Window? Thats another that will cause you grief if you ever lowercase it by accident: parent.window.location td>Our Travels</td /TR /TABLE Well, my whole goal was to make the entire cell clickable. top takes me out |
#10
| |||
| |||
|
|
Wojtek Bok wrote: |
|
Keep a status variable for each link. Use onClick to go to a function which changes the state of the variable and changes the CSS for the link (thus changing its colour). Use Ajax to send the new state back to your server. Finally visit the link. When refreshing the page, use the state information to set the starting values for the variable and CSS. Ajax? never heard of it. In any case I wouldnt want to install some new enivronment just to solve a table cell problem. |
![]() |
| Thread Tools | |
| Display Modes | |
| |