Hi, I have a problem. I need to scroll an element from the binding on click, but I get an error:
SyntaxError: missing} after property list
scrollTop: $( $(this).attr('href') )element.offset().top
$(document).ready(function(){
$('nav#site-navigation ul li').click(function(){
$('html, body').animate({
scrollTop: $( $(this).attr('href') ).offset().top
}, 1000);
return false;
});
});
Anchor is in the WP navigation menu.
source
share