SyntaxFix
Write A Post
Hire A Developer
Questions
Code with click function()
var body = $('html, body'); $('.toTop').click(function(e){ e.preventDefault(); body.animate({scrollTop:0}, 500, 'swing'); });
.toTop = class of clicked element maybe img or a
.toTop
img
a