SyntaxFix
Write A Post
Hire A Developer
Questions
You can extend jQuery functionalities like this:
jQuery.fn.extend({ scrollToMe: function () { var x = jQuery(this).offset().top - 100; jQuery('html,body').animate({scrollTop: x}, 500); }});
and then:
$('...').scrollToMe();
easy ;-)