I have this piece of code and I have a simple question.
$(window).scroll(function() {
var y_scroll_pos = window.pageYOffset;
var scroll_pos_test = 150; // set to whatever you want it to be
if(y_scroll_pos > scroll_pos_test) {
$( "#cssmenu" ).addClass("extend");
} else if(y_scroll_pos < scroll_pos_test) {
$( "#cssmenu" ).addClass("contract");
}
});
I have linked a CSS file ( via href="css/style.css") and I would like to use .extend and .contract from such file.
Is this possible?
Thank you.