Hi, you can check this to get started: http://jsfiddle.net/rcAev/177/
Here I made this function:
$(document).ready (function () {
$(window).scroll (function () {
var sT = $(this).scrollTop();
if (sT >= 300) {
$('.overlay').addClass('cambio')
}else {
$('.overlay').removeClass('cambio')
}
})
})
I will explain to you step by step:
- This function is executed first every time the window is scrolled.
$ (window) .scroll (function ()
- Second, read the value from the top of the scroll to see how much you are promoting.
var sT = $ (this) .scrollTop ();
In the third comparison with the breakpoint you want, in this case I choose 300 because I want to change the navigation after going through the height of the image shape.
if (sT >= 300) {
}else {
}
Fourthly, to change the transparency of the color applied by me, add class
with a new background and a different height:
$('.overlay').addClass('cambio')