PDA

View Full Version : PHP Photo Album script - vertical and horizontal alignment



Nokonium
08-05-2006, 08:21 PM
1) Script Title: PHP Photo Album script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm

3) Describe problem: I am testing the above and I've hit a problem. I want to use the script to display smilies (many animated gifs) I have the script working OK, I have added my own html content etc. where I am stuck is here


var curimage=0
for (y=0; y<dimension.split("x")[1]; y++){
for (x=0; x<dimension.split("x")[0]; x++){
if (curimage<galleryarray.length)
document.write('<div id="slide'+curimage+'" class="slideshow"> '+buildimage(curimage)+'</div>')
curimage++
}
document.write('<br style="clear: left" />')
}

}

Smilies are not all the same height or width so I would like to align them in the center and vertically align them to the bottom. I have attached a screenshot of what I have, the border was added to troubleshoot.

jscheuer1
08-05-2006, 10:08 PM
Hard to test out seeing as it is PHP driven but, I would try replacing this:


document.write('<div id="slide'+curimage+'" class="slideshow"> '+buildimage(curimage)+'</div>')


With this:


document.write('<table class="slideshow" id="slide'+curimage+'"><tr><td align="center" valign="bottom">'+buildimage(curimage)+'</td></tr></table>')

A link to your page might help me to troubleshoot this if there are any problems.