Jquery 如何使此旋转器具有基于内容的动态高度?
请浏览: 如您所见,若不在CSS的第6行中指定固定高度,则此旋转器无法工作。我需要这个小部件根据内容高度动态调整其高度,而不需要剪切它或留下太多的空白空间 以下是css:Jquery 如何使此旋转器具有基于内容的动态高度?,jquery,html,css-float,overflow,css-position,Jquery,Html,Css Float,Overflow,Css Position,请浏览: 如您所见,若不在CSS的第6行中指定固定高度,则此旋转器无法工作。我需要这个小部件根据内容高度动态调整其高度,而不需要剪切它或留下太多的空白空间 以下是css: .rotator { position: relative; overflow:hidden; width: 100%; border:1px solid red; height:auto; /*height:100px;*/ } .rotator ul li { max-height: 1
.rotator {
position: relative;
overflow:hidden;
width: 100%;
border:1px solid red;
height:auto; /*height:100px;*/
}
.rotator ul li {
max-height: 100%;
max-width: 100%;
background-color:aqua;
}
我留下了jQuery脚本,以便您能够理解我试图使用它的目的
我错过了什么
谢谢。第一件事是移除
position: 'absolute'
从你的js文件
然后,在next()和prev()函数中更改动画,以使票据运行更平稳
看看这个。谢谢你的帮助。如果我想要正确的堆叠,交叉淡入似乎不是一个选项,因此我最终对js进行了如下调整: