$(window).scroll(function() {
var swipeHeight = 200;//完全变色高度
var scrollTop = $(document).scrollTop();//页面滚动高度
var x = scrollTop/swipeHeight;
$(".head-bg").css({"opacity":x});
})
Posted 诩小贝
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了滚动一定的高度底色递增相关的知识,希望对你有一定的参考价值。
$(window).scroll(function() {
var swipeHeight = 200;//完全变色高度
var scrollTop = $(document).scrollTop();//页面滚动高度
var x = scrollTop/swipeHeight;
$(".head-bg").css({"opacity":x});
})
以上是关于滚动一定的高度底色递增的主要内容,如果未能解决你的问题,请参考以下文章