Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript scroll to top of page

//Instant scroll to top of page
window.scrollTo(0, 0);
Comment

javascript go to top of page

window.scroll({
 top: 0, 
 left: 0, 
 behavior: 'smooth' 
});
Comment

javascript go to top of page

window.scroll({top: 0, left: 0});
//Or with jQuery
$('html,body').scrollTop(0);
//with animation
$('html, body').animate({ scrollTop: 0 }, 'fast');
Comment

PREVIOUS NEXT
Code Example
Javascript :: angular validators number only in reactive form 
Javascript :: jquery-3.5.1.slim.min.js download 
Javascript :: ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js): Error: ENOENT: no such file or directory, scandir 
Javascript :: js loop array backward 
Javascript :: how to restart elasticsearch node 
Javascript :: javascript generate random color 
Javascript :: javascript replace line breaks with br 
Javascript :: angular valuechanges get id 
Javascript :: java sleep 1 sec 
Javascript :: javascript get element by class name 
Javascript :: react native cover image 
Javascript :: google dino game hack 
Javascript :: remove localstorage 
Javascript :: javascript remove spaces at the beginning of the end of the string 
Javascript :: How to get current URL with Javascript or React 
Javascript :: disable sequelize logging 
Javascript :: javascript celcius to farenheit 
Javascript :: authfunctions react 
Javascript :: regular expression to remove empty lines after text 
Javascript :: is advanced functions harder than calculus 
Javascript :: arraylist of characters 
Javascript :: jquery scroll to top 
Javascript :: javascript throw vs console.error 
Javascript :: Select at random from array 
Javascript :: Extract number from string javascripy 
Javascript :: how to get client.user.avatar 
Javascript :: give height to Image in nextjs 
Javascript :: how to select html body in javascript 
Javascript :: execute javascript function when page loads 
Javascript :: jquery onscroll sticky header 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =