Jsfiddle
I decided to redesign my site today by adding some scroll effects through jQuery + CSS3.
I have a set of divs arranged horizontally and vertically.
I am trying to apply this effect , so each divwill fade / scale when scrolling and fade / zoom when fading / scaling the other.
I know that I can use .scrollan event handler, but I'm not sure how it will be used for this type of effect.
Here the current jQuery is added at the time of publication.
$(document).ready(function() {
$(".container").scroll(function() {
if ($(".container").scrollTop() > 50) {
$(".container div").css('background', 'rgb(200, 54, 54)').stop().animate({"opacity":".5"}, 1000)
}
});
});
source
share