scrollTop with animation

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" });
function dotNavigation(element) { // no matching }

see comment

I don’t understand your reply.

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?

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