I hate to bother you guys with this, but it's driving me crazy... Im helping my Dad build a portfolio website... so far so good. I decided to use a simple jQuery image gallery I found on Webdesignerwall.com.... http://www.webdesignerwall.com/demo/jqu ... ement.html
It does exactly what I want it to do, but the only problem is that if the images aren't all the exact same height they stretch and become distorted when browsing through the gallery. So maybe this is a jQuery problem, not CSS...?
You'll notice that at first the image dimensions get screwed up completely... but if you keep clicking through the gallery they eventually fix themselves and display as they should. Is there anyway to prevent the images from having this problem at all? Please let me know, Im pulling my hair out trying to figure this out and I really dont want to change all the images to be the exact same dimensions as a shortcut to solve this problem.
Here is the jQuery code (unaltered besides the heading tags, I used exactly what WDW provided):
Hey chazzwick... that wasn't quite it (unless I did something wrong)... but you got me on the right track! I created a new div around the largeImg called largeImgWrapper and gave it these styles:
Now it works in Firefox perfectly. Try it out. Unfortunately it still isn't working properly in IE. If you try it in IE, you have to click the thumbnail twice for it to adjust to the correct dimensions. Anyone have any idea how to that?
It does exactly what I want it to do, but the only problem is that if the images aren't all the exact same height they stretch and become distorted when browsing through the gallery. So maybe this is a jQuery problem, not CSS...?
View this page and try clicking the second or third image in the gallery on the bottom of the page...
http://garyawinter.com/wordpress/?page_id=16
You'll notice that at first the image dimensions get screwed up completely... but if you keep clicking through the gallery they eventually fix themselves and display as they should. Is there anyway to prevent the images from having this problem at all? Please let me know, Im pulling my hair out trying to figure this out and I really dont want to change all the images to be the exact same dimensions as a shortcut to solve this problem.
Here is the jQuery code (unaltered besides the heading tags, I used exactly what WDW provided):
The markup:
And in case it matters, the CSS:
div.portfolio-img {
height:xxx px;
width:yyy px;
overflow: hidden;
}
then set the image to be the same width as its containing div:
div.portfolio-img img {width:yyy px;
}
then it should keep to your dimensions without stretching the image.
I created a new div around the largeImg called largeImgWrapper and gave it these styles:
Now it works in Firefox perfectly. Try it out.
Unfortunately it still isn't working properly in IE. If you try it in IE, you have to click the thumbnail twice for it to adjust to the correct dimensions. Anyone have any idea how to that?
Thanks again chazzwick!
http://garyawinter.com/wordpress/?page_id=16