Wordpress Menus

0

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.

    
asked by anonymous 21.09.2014 / 18:02

1 answer

1

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;
      }
    }
  });
});

font

    
22.09.2014 / 04:16