singedpiper
01-17-2005, 06:11 PM
ok, heres the deal... i (not knowing javascript very well, and being self taught (a bad sign) in a night (a worse sign)) managed to hack out the code for a thumbnail gallery much like you would normally code with php... i did this because the site i am making is hosted on a school server that doesn't allow php (damn luddites)
here's the test posting of the site:
http://www.geocities.com/wide_area_intelligence_project/
the issues here are on the page you reach by clicking an image in the gallery
so anyway, the gallery has an array of strings backing its implementation that looks like this:
...[image filepath][thumbnail filepath][title][caption]...
now at the bottom of the viewer page i made a little row of the thumbnails of the 2 previous, the current, and the 2 next thumbnails. thumbnails have a maximum hieght/width of 100pixels
my problem is threefold
1) if I give each image a border, I cannot make it rollover, using rollover css that works other places
2) if I try to make the entire table cell a rollover, like i have done elsewhere, it won't take effect
3) this one's just annoying, when there is no image in a certain position. the table shifts a bit, and i don't know why
<tr>
<td width = 100> </td>
<td width = 100 valign = center align = center>
<script language="JavaScript" type="text/javascript"><!--
if(currentPic +8 < galleryData.length)
{
document.write('<a href = " viewpic.html?first_num=' + firstnum + ':pic_num=' + (currentPic +8) + '"><img src= " ' + getGalleryData(currentPic +8+1) + ' " border = 0 ></a>')
}
else
{
document.write(' ')
}
//--></script>
</td>
<td width = 100 valign = center align = center>
<script language="JavaScript" type="text/javascript"><!--
if(currentPic +4 < galleryData.length)
{
document.write('<a href = " viewpic.html?first_num=' + firstnum + ':pic_num=' + (currentPic +4) + '"><img src= " ' + getGalleryData(currentPic +4+1) + ' " border = 0 ></a>')
}
else
{
document.write(' ')
}
//--></script>
</td>
<td width = 100 valign = center align = center>
<script language="JavaScript" type="text/javascript"><!--
document.write('<a href = " viewpic.html?first_num=' + firstnum + ':pic_num=' + currentPic + '"><img src= " ' + getGalleryData(currentPic+1) + ' " border = 2 ></a>')
//--></script>
</td>
<td width = 100 valign = center align = center>
<script language="JavaScript" type="text/javascript"><!--
if(currentPic -4 >=0)
{
document.write('<a href = " viewpic.html?first_num=' + firstnum + ':pic_num=' + (currentPic -4) + '"><img src= " ' + getGalleryData(currentPic -4+1) + ' " border = 0></a>')
}
else
{
document.write(' ')
}
//--></script>
</td>
<td width = 100 valign = center align = center>
<script language="JavaScript" type="text/javascript"><!--
if(currentPic -8 >=0)
{
document.write('<a href = " viewpic.html?first_num=' + firstnum + ':pic_num=' + (currentPic -8) + '"><img src= " ' + getGalleryData(currentPic -8+1) + ' " border = 0 ></a>')
}
else
{
document.write(' ')
}
//--></script>
</td>
<td width = 100> </td>
</tr>
how can i implement the highlighting i did on the central thumbnail as a rollover effect?
also, any other suggestions on design or implementation would be welcome
here's the test posting of the site:
http://www.geocities.com/wide_area_intelligence_project/
the issues here are on the page you reach by clicking an image in the gallery
so anyway, the gallery has an array of strings backing its implementation that looks like this:
...[image filepath][thumbnail filepath][title][caption]...
now at the bottom of the viewer page i made a little row of the thumbnails of the 2 previous, the current, and the 2 next thumbnails. thumbnails have a maximum hieght/width of 100pixels
my problem is threefold
1) if I give each image a border, I cannot make it rollover, using rollover css that works other places
2) if I try to make the entire table cell a rollover, like i have done elsewhere, it won't take effect
3) this one's just annoying, when there is no image in a certain position. the table shifts a bit, and i don't know why
<tr>
<td width = 100> </td>
<td width = 100 valign = center align = center>
<script language="JavaScript" type="text/javascript"><!--
if(currentPic +8 < galleryData.length)
{
document.write('<a href = " viewpic.html?first_num=' + firstnum + ':pic_num=' + (currentPic +8) + '"><img src= " ' + getGalleryData(currentPic +8+1) + ' " border = 0 ></a>')
}
else
{
document.write(' ')
}
//--></script>
</td>
<td width = 100 valign = center align = center>
<script language="JavaScript" type="text/javascript"><!--
if(currentPic +4 < galleryData.length)
{
document.write('<a href = " viewpic.html?first_num=' + firstnum + ':pic_num=' + (currentPic +4) + '"><img src= " ' + getGalleryData(currentPic +4+1) + ' " border = 0 ></a>')
}
else
{
document.write(' ')
}
//--></script>
</td>
<td width = 100 valign = center align = center>
<script language="JavaScript" type="text/javascript"><!--
document.write('<a href = " viewpic.html?first_num=' + firstnum + ':pic_num=' + currentPic + '"><img src= " ' + getGalleryData(currentPic+1) + ' " border = 2 ></a>')
//--></script>
</td>
<td width = 100 valign = center align = center>
<script language="JavaScript" type="text/javascript"><!--
if(currentPic -4 >=0)
{
document.write('<a href = " viewpic.html?first_num=' + firstnum + ':pic_num=' + (currentPic -4) + '"><img src= " ' + getGalleryData(currentPic -4+1) + ' " border = 0></a>')
}
else
{
document.write(' ')
}
//--></script>
</td>
<td width = 100 valign = center align = center>
<script language="JavaScript" type="text/javascript"><!--
if(currentPic -8 >=0)
{
document.write('<a href = " viewpic.html?first_num=' + firstnum + ':pic_num=' + (currentPic -8) + '"><img src= " ' + getGalleryData(currentPic -8+1) + ' " border = 0 ></a>')
}
else
{
document.write(' ')
}
//--></script>
</td>
<td width = 100> </td>
</tr>
how can i implement the highlighting i did on the central thumbnail as a rollover effect?
also, any other suggestions on design or implementation would be welcome