Back to top button | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Back to top button

I made this page and designed a fixed button in the bottom right corner to jump to the top of the page. I made it work with the # (pound symbol)... can anyone help me to do it same with jQuery ? https://code.sololearn.com/WUS29rwzz5tv/?ref=app

11th Feb 2018, 11:08 AM
Siddhant Singh
Siddhant Singh - avatar
5 Answers
+ 4
Then <button onclick="$('body').animate({scrollTop:0},500)" ><span>Top</span></button> or used loop as he said for faster optimize
11th Feb 2018, 11:37 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 8
<button onclick="$(window).scrollTop(0)"><span>Top</span></button>
11th Feb 2018, 11:20 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 2
how can we make the scrolling smooth?
11th Feb 2018, 5:15 PM
Siddhant Singh
Siddhant Singh - avatar
+ 2
Thx
12th Feb 2018, 1:32 AM
Siddhant Singh
Siddhant Singh - avatar
+ 1
Maybe if you use a loop?
11th Feb 2018, 6:51 PM
Jonas Schröter
Jonas Schröter - avatar