danfirst
Mar 20th 2008, 7:24 pm
Hi, I'm really no expert. I don't even know if this is called hypercell.
But this seems like a simple thing, which I'm sure will be a piece of cake to the gurus out there.
I'm using this particular javascript technique whereby when a cell in a table has "onmouseover" the cell changes color, and when the cell has "onmouseout" it goes to a link.
A simple sample is as attached. Or basically the whole sample script is like this:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<script type="text/javascript">
function link1(){
window.location.href="http://www.google.com/";
}
</script>
<script type="text/javascript">
function link2(){
window.location.href="http://www.yahoo.com/";
}
</script>
</head>
<body>
<center>
<table border="1" width="200" cellspacing="0" cellpadding="0" height="100">
<tr>
<td onmouseover="this.style.background='#F1F7FA';this.style.cursor='pointer'" onmouseout="this.style.background='white';" onclick="link1()" width="50%" align="center">
<p align="center">Link to Google</td>
<td width="50%" align="center">
</td>
</tr>
<tr>
<td onmouseover="this.style.background='#F1F7FA';this.style.cursor='pointer'" onmouseout="this.style.background='white';" onclick="link2()" width="50%" align="center">
Link to Yahoo!</td>
<td width="50%" align="center">
</td>
</tr>
</table>
</center>
</body>
</html>
This script works great. Just that:
1. How do we make the links open in a new window?
2. When we click on the cells, how do we parse the REFERRER info as well as the cookie info? I find that using this script just treats the click as a new click to the link, but I'm sure that some info can be parsed.
.
But this seems like a simple thing, which I'm sure will be a piece of cake to the gurus out there.
I'm using this particular javascript technique whereby when a cell in a table has "onmouseover" the cell changes color, and when the cell has "onmouseout" it goes to a link.
A simple sample is as attached. Or basically the whole sample script is like this:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<script type="text/javascript">
function link1(){
window.location.href="http://www.google.com/";
}
</script>
<script type="text/javascript">
function link2(){
window.location.href="http://www.yahoo.com/";
}
</script>
</head>
<body>
<center>
<table border="1" width="200" cellspacing="0" cellpadding="0" height="100">
<tr>
<td onmouseover="this.style.background='#F1F7FA';this.style.cursor='pointer'" onmouseout="this.style.background='white';" onclick="link1()" width="50%" align="center">
<p align="center">Link to Google</td>
<td width="50%" align="center">
</td>
</tr>
<tr>
<td onmouseover="this.style.background='#F1F7FA';this.style.cursor='pointer'" onmouseout="this.style.background='white';" onclick="link2()" width="50%" align="center">
Link to Yahoo!</td>
<td width="50%" align="center">
</td>
</tr>
</table>
</center>
</body>
</html>
This script works great. Just that:
1. How do we make the links open in a new window?
2. When we click on the cells, how do we parse the REFERRER info as well as the cookie info? I find that using this script just treats the click as a new click to the link, but I'm sure that some info can be parsed.
.