我制作了w3.css框架支持的这些代码段,并希望添加任何语言的功能(最好是C#,javascript-jquery),以使div在您向下滚动时以相同的速率向上移动,反之亦然。 ..
<head>
<style href="https://www.w3schools.com/w3css/4/w3.css">
</head>
<div style="position:static;width:100%" class="w3-padding-16 w3-container w3-white">
<h2>About us</h2>
<p>
{{long text goes here}}
</p>
</div>
<script>
$(".w3-white").css({
opacity: function () {
var elementHeight = $(this).height(),
opacity = ((1 - (elementHeight - scrollTop) / elementHeight) * 0.8) + 0.2;
return opacity;
}
});
</script>