Reputation: 2261
I have a photo gallery in my website...The photos are in dialog with next,prev,close buttons. Each next/prev event I load a new image into the dialog...Photos have a different width-How can I load the pictures at the same position? I mean because the pictures are with different width the position of the images is changing...
Upvotes: 0
Views: 387
Reputation: 15705
Personally, I think your best option is to try and work with the fact that each image is a different size. Create a transition effect that enlarges and shrinks your slideshow to fit the size of the image within. Makes for a much smoother, more trendy effect - if that's what you're looking for.
Upvotes: 1
Reputation: 5413
If you use some sort of centering, the change in width won't be a problem because they will all be centered correctly. Then all you have to do is position a known-width element that won't change depending on the image.
<div class="viewer">
<img/>
</div>
.viewer{
text-align: center;
}
.viewer img{
margin: auto;
}
Upvotes: 2