Sunday, 11 August 2013

change var value onscroll Jquery

change var value onscroll Jquery

I am making a function and i have added if statement at the top of it. I
want to change variable value when user scroll. If the user scroll if
statement check variable value and run the function inside if statement
var usrscrolled = 'notscroll';
function scrolled() {
//do by scroll start
usrscrolled = 'scroll';
}
$(window).on('scroll', scrolled);
if (usrscrolled = 'notscroll') {
}
this code works but onscroll variable dont change and if statement runs on
scroll

No comments:

Post a Comment