Zedzero
Oct 30th 2005, 11:45 pm
for my new site, i need to let visitors click on an image, and according to the pixel they clicked on, they will be redirected to a new page.
what i tried:
- make a table with the said image as background, and 1x1 td's all over. so it would be easy to add onClick to each td. even on my local server it took like 5 minutes to load. because all of the code was generated serverside.
security is not a concern on this project, so then i tried to create the same thing with javascript:
<script type="text/javascript">
width = 480;
height = 640;
document.write("<table background=a.jpg border=0 width="+width+" height="+height+" cellpadding=0 cellspacing=0>")
for (i = 1; i <= height; i++)
{
document.write("<tr>");
for (j = 1; j <= width; j++)
{
document.write("<td></td>");
}
document.write("</tr>");
}
document.write("</table>");
</script>
this didn't even work. now i'm not into js very much, and i coded this looking at some examples and tutorials. so don't laugh please :)
- what is wrong here?
- do you have any other idea to implement this? (i don't want to use flash)
what i tried:
- make a table with the said image as background, and 1x1 td's all over. so it would be easy to add onClick to each td. even on my local server it took like 5 minutes to load. because all of the code was generated serverside.
security is not a concern on this project, so then i tried to create the same thing with javascript:
<script type="text/javascript">
width = 480;
height = 640;
document.write("<table background=a.jpg border=0 width="+width+" height="+height+" cellpadding=0 cellspacing=0>")
for (i = 1; i <= height; i++)
{
document.write("<tr>");
for (j = 1; j <= width; j++)
{
document.write("<td></td>");
}
document.write("</tr>");
}
document.write("</table>");
</script>
this didn't even work. now i'm not into js very much, and i coded this looking at some examples and tutorials. so don't laugh please :)
- what is wrong here?
- do you have any other idea to implement this? (i don't want to use flash)