我在 div 中使用 Nivo Slider jQuery 插件,它的尺寸比我显示的图像小。当 Slider 滑动到第二张图片时,图片会正确缩小。
但是当第一张图片第一次显示时(加载页面后),它只缩放宽度,不缩放高度。我该如何改变它?
例子: 比方说,我所有的图像都有 1024*768 像素的大小。 div 的宽度为 400px。我在 slider 中有 3 张图片。
- 加载图像 1 后立即以 400*768 像素 (错误)
- 然后滑动到400*300像素的图片2
- 然后以 400*300 像素制作图像 3
- 然后到 400*300 像素 (右) 中的图像 1
- ...
编辑:我刚刚注意到,这只发生在 IE 中,在 Firefox 中没有这样的错误。
最佳答案
我也遇到了同样的问题 - 我将 height: auto !important;
添加到 .nivo-main-image
。
关于jquery - Nivo slider : First image is scaled unproportional when displayed the first time,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14872634/