gpt4 book ai didi

jquery - 滚动 div 内的动画图像

转载 作者:行者123 更新时间:2023-11-28 04:13:20 24 4
gpt4 key购买 nike

上周,我一直在尝试寻找一种方法,让 div/图像在可滚动的 div 中进行动画处理。我试过wow.js (与 animate.css )和 aos.js ,我被告知这两者都不会在容器 div 中工作。

我试过了 Waypoints在尝试之后 This Solution运气不好,我开始认为这是不可能的,但我很乐意被证明是错误的。我想使用 animate.css,因为它有我喜欢的动画并且很容易处理,但如果那不是一个选项,那就这样吧。

最佳答案

你没有提到你想要什么样的动画。但这可能会让你开始滚动 div 动画:(只需向下滚动到底部)

$(document).scroll(function () {
var y = $(this).scrollTop();
if (y > 800) {
$('.bottomMenu').fadeIn();
} else {
$('.bottomMenu').fadeOut();
}

});
body {
height:1600px;
}
.bottomMenu {
display: none;
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
border-top: 1px solid #000;
background: red;
z-index: 1;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="bottomMenu"></div>

关于jquery - 滚动 div 内的动画图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42607160/

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