<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
标签 javascript jquery html css
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
如果您点击此链接关注该网站
密切注意标题 slider 的加载方式。
如果您注意到,它会在 100% 加载 div 之后折叠,然后再用图像展开。图片和幻灯片由背景图片和 CSS 渐变组成。
在JS脚本中,它设置了header div为自动高度,但我不熟悉如何在loading div之后设置一个设置高度,以防止折叠。
最佳答案
您可以在 CSS 中向元素添加一个 min-height
,使其在加载图像时等于 div 的高度。您不需要弄乱 JS。
这样,它只会扩展元素的高度,而不会折叠然后展开。
关于javascript - 加载时崩溃时网站 javascript 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29950150/