嗨,我在使用 jQuery 循环的响应式图片库时遇到问题。
我的小提琴在这里 - https://jsfiddle.net/qxyodctm/5/
<html>See jsfiddle</html>
仅当您刷新浏览器时,您才会看到图像调整大小并正确限制其比例 - 但在浏览器缩放时,它们不会相互重叠并且宽度和高度错误。
有人帮忙吗?
非常感谢
嗨,我在使用 jQuery 循环的响应式图片库时遇到问题。
我的小提琴在这里 - https://jsfiddle.net/qxyodctm/5/
<html>See jsfiddle</html>
仅当您刷新浏览器时,您才会看到图像调整大小并正确限制其比例 - 但在浏览器缩放时,它们不会相互重叠并且宽度和高度错误。
有人帮忙吗?
非常感谢
我已经更新了图库以使用新的 jQuery 循环库 -'cycle2',并且看起来效果很好。我将很快更新 jsfiddle 以反映。
It's your slider plugin that's causing you so much misery. The jQuery automatically sets inline styles to the Ul.slides position: relative; width: 580px; height: 432px;
, which of course, are set to the width of the browser when the page is first loaded, but not updated when the page size changes.
Generally, this isn't too big of a concern, because usually the only people who see this will be those testing for responsiveness (and resizing their browser), but it'll load properly for those who just visit on their tablet or whatever (and incidentally, won't/can't resize their browser).
If you want to fix it, you'll have to create some of your own javascript code which selects ul.slides and changes the width on page resize.