Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery scroll to element toggle menu item

$('.scrollto').click(function() {
	$('.article-aside__li').removeClass('is-active');
    $('html, body').animate({
        scrollTop: eval($('#' + $(this).attr('target')).offset().top - 10)
    }, 1000);
	$(this).parent('li').toggleClass('is-active');
	console.log(this);
});
 
PREVIOUS NEXT
Tagged: #jquery #scroll #element #toggle #menu #item
ADD COMMENT
Topic
Name
1+1 =