show class when scroll down between ID=A and ID=B
I have this script but it won't work in FOUNDATION because the pixels
values. I need to show a div when user scroll down between two ID's
var cvHeight = $("#CV").css.height();
var cvStart = $("#TOP").css.height() + $("#NAV").css.height() +
$("#PIX").css.height() + $("#DATO_UR").css.height() +
$("#TEASER").css.height() + $("#TIPS").css.height() +
$("#REFERENCER").css.height();
var cvEnd = cvStart + cvHeight;
// pixel values 1800 & 5550
$(window).scroll(function () {
if ($(this).scrollTop() > cvStart && $(this).scrollTop() < cvEnd) {
$("#cvBoxWrap").fadeIn();
} else {
$("#cvBoxWrap").fadeOut();
}
});
No comments:
Post a Comment