if( $('html,body').scrollTop() != 150 ){
$('html,body').animate({scrollTop: 150},'slow');
}
I’m trying to check if the height of the scroll is not 150, and if that’s true I’d like to move the scroll to 150, How can I do this ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hiya try this working demo http://jsfiddle.net/jqj9T/
This will help, Please let me know if I am missing anything,
scrollTop: $(window).scrollTop() + 150should do the trick.Jquery code