嗨,我想在某个特定部分添加一个课程。模糊图像。
参考:https://www.stanford.edu/。我想在用户滚动到某个部分时模糊图像。
当您想要模糊图像的DIV位于页面顶部或某个特定位置时,您希望添加课程。
您必须获得DIV的动态滚动顶部(使图像模糊)。或者你可以在jQuery术语中说Offset。
var YourDiv = $(".YourDivHavingImageToBeBlur");
$(window).scroll(function() {
var scroll = $(window).scrollTop();
// Here You can add your conditions according to your requirments
if (scroll == YourDiv.offset().top ) {
YourDiv.addClass('YourClass');
}
});