3
我正在尝试使如果向下滚动,出现模糊的图片(不透明度),并且如果您位于页面底部,则模糊的图片完全可见并且旧的一个消失了。我为每个页面使用相同的pagecontainer,并且我想让这个脚本在每个页面上都做这件事,用不同的页面长度。基于页面长度的模糊背景
我有这个至今:
CSS:
.img-src {
position: fixed;
background-position: center;
-webkit-background-size: cover;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
}
.blurred-img {
opacity: 0;
}
JS:
var divs = $('.social, .title'),
limit = 0;
$(window).on('scroll', function() {
var st = $(this).scrollTop();
if (st <= limit) {
$('.blurred-img').css({ 'opacity' : (1 - st/limit) });
}
});
那么,什么是它做/不做VS的期望是什么? – csmckelvey
为什么不使用'filter:blur()'? – gcampbell
@takendarkk这是模糊的,但在漫长的页面中,它在页面中间完全模糊,在小页面上,在页面末尾只有一半模糊(或更少)。 – SuperTint