cpthompson82
04-15-2010, 12:26 PM
1) Script Title: PHP Photo Album 2.11
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm
3) Describe problem: I have the script working well here http://www.rjt-online.com/2010%20Website/photos_live.php.
However, if the photo is Portrait and the correct width, it fits the containter div nicely (photodiv).
However if the photo is landscape or larger portrait, the image is cropped.
I dont want the images to be shrunk by x% as come images are landscape and others are portrait.
How can I modify my CSS so each image, regardless of the size and regardless of it being portrait/lanscape, fits centrally in the photodiv with equal overflow (hidden) on each side?
If an images is 500px wide and the photodiv is 200px wide, I want somehow to automatically calculate per image the left and right margins. In this case it would calculate that the left margin needs to be -150px and the righht maring needs to be 150px, therefore the center of the image should be in the center of the photodiv regardless of the size of image.
Any help would be appreciated.
Thanks.
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm
3) Describe problem: I have the script working well here http://www.rjt-online.com/2010%20Website/photos_live.php.
However, if the photo is Portrait and the correct width, it fits the containter div nicely (photodiv).
However if the photo is landscape or larger portrait, the image is cropped.
I dont want the images to be shrunk by x% as come images are landscape and others are portrait.
How can I modify my CSS so each image, regardless of the size and regardless of it being portrait/lanscape, fits centrally in the photodiv with equal overflow (hidden) on each side?
If an images is 500px wide and the photodiv is 200px wide, I want somehow to automatically calculate per image the left and right margins. In this case it would calculate that the left margin needs to be -150px and the righht maring needs to be 150px, therefore the center of the image should be in the center of the photodiv regardless of the size of image.
Any help would be appreciated.
Thanks.