I would like to change a ul style on scrolling and arrive to div using jQuery, explanation down.
CSS:
#menu {
background-color:#ccc;
position
Try something like this jsFiddle
$(document).scroll(function () {
var y = $(this).scrollTop();
if (y > 275) {
$(".menutext").addClass(
"menutext2");
} else {
$(".menutext").removeClass(
"menutext2");
}
});
I have this set to add .menutext2 after you've scrolled down 275px, approximate top of div2, it shouldn't be hard to figure it out from here.