Nivo Slider: First image is scaled unproportional when displayed the first time

Hinek picture Hinek · Feb 14, 2013 · Viewed 9k times · Source

I'm using the Nivo Slider jQuery Plugin in a div that has a smaller size then the images I'm displaying. When the Slider slides to the second image an on the images are scaled down correctly.

But when the first image is displayed for the first time (directly after loading the page), it is scaled only in width, but not in height. How can I change that?

Example: Let's say, all my images have a size of 1024*768 pixels. The div has a width of 400px. And I have 3 images in the slider.

  • directly after loading image 1 is displayed with 400*768 pixels (wrong)
  • then it slides to image 2 in 400*300 pixels
  • then to image 3 in 400*300 pixels
  • then to image 1 in 400*300 pixels (right)
  • ...

image 1 wrong image 2 right

EDIT: I just noticed, this only happens in IE, in Firefox there is no such error.

Answer

Cyndeed picture Cyndeed · Feb 25, 2013

I had the same problem too - I added height: auto !important; to .nivo-main-image.