I made a simple html file, with anchor links that can be clicked to scroll smoothly to their respective part of the page ( tags). The problem is that the scroll is not smooth at all! I watched a tutorial on youtube and the code used in there was (here's the code I adapted to fit on my project, but the way is the same):
function goto(numsection){
var section = $('#section'+numsection);
var offset = section.offset().top;
$(document).scrollTop(offset);
$(section).slide('slow');
}
When I click an anchor, the page scrolls down to the respective section, but the transition is immediate. In JavaScript console there's this error:
Uncaught TypeError: undefined is not a function
I don't understand, in the tutorial worked perfectly.
PS: I want to use slide()
function if possible, not slideToggle()
or similar.