scrollTop with animation


#1

I’m using jQuery to give my scrollTop a animation, but it says “Unexpected end of input”.
I really don’t know to put my values correctly inside the animate function, if someone could help me, I would appreciate that.

// Onclick function for the side navigation
	function dotNavigation(element) {		
		var id = element.id.substr(3);
		var s = ($(window).height()-96) * (id-1);
		$("html, body").animate({ scrollTop: $s + "300" + "px" });

#2
function dotNavigation(element) { // no matching }

see comment


#3

I don’t understand your reply.


#4

Check that your variables are consistent.

s vs $s

What is the value of id? In the line that polls it we see subtraction. Are you certain that id is a number?


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.