gpt4 book ai didi

javascript - 图像未转换为图像轮播中的正确尺寸

转载 作者:行者123 更新时间:2023-11-29 22:11:37 27 4
gpt4 key购买 nike

在图像轮播中围绕图像添加 anchor 标记时(使用“carouFredSel”6.2 jQuery 库),图像未正确转换为正确的尺寸。删除 anchor 标记时,图像会转换为正确的尺寸并按预期工作。 CSS 也已更改,因此应用于图像的所有样式现在都应用于 anchor 标记,但问题仍未解决。

为了演示该问题,我在 JSFiddle 上重现了该问题,并在另一个 fiddle 中重现了预期结果。实际使用的 Javascript 代码从第 19 行开始。

Actual result

Expected result

值得注意的是,我已经更改了这个片段:

#carousel img {
display: block;
float: left;
border: none;
position: relative;
}

#carousel a {
display: block;
float: left;
border: none;
position: relative;
}

将样式应用于 anchor 标记而不是图像,这反射(reflect)在 JSFiddle 的代码中。

最佳答案

您的问题出在 js 中,它在 a 而不是 img 上应用了 css。部分解决,不幸的是我现在没有足够的时间,但你可以从 here 开始我添加 .children() 以获得 img intead of a

关于javascript - 图像未转换为图像轮播中的正确尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17855869/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com