I have to make a website, those with a page with only automatic scrolling, but in Wordpress. What is the function that I can use that does this? I mean, just the ones that bring the menu items.
I have to make a website, those with a page with only automatic scrolling, but in Wordpress. What is the function that I can use that does this? I mean, just the ones that bring the menu items.
If it's what I understand, you can use this code (jquery)
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});