javascript go to top of page
window.scroll({
top: 0,
left: 0,
behavior: 'smooth'
});window.scroll({top: 0, left: 0});
//Or with jQuery
$('html,body').scrollTop(0);
//with animation
$('html, body').animate({ scrollTop: 0 }, 'fast');window.scroll({
top: 0,
left: 0,
behavior: 'smooth'
});window.scrollTo(x-coord, y-coord);//EITHER:
window.scroll({
top: 0,
left: 0,
behavior: 'smooth'
});
//*****************************
//OR:
window.scroll({top: 0, left: 0});
//Or with jQuery
$('html,body').scrollTop(0);
//with animation
$('html, body').animate({ scrollTop: 0 }, 'fast');window.scroll({top: 0, left: 0});
//Or with jQuery
$('html,body').scrollTop(0);
//with animation
$('html, body').animate({ scrollTop: 0 }, 'fast');
Also in JavaScript:
- react native timed out waiting for modules to be invalidated
- uuid react native expo
- hide show div jquery
- dark mode with react hooks
- Uncaught TypeError: jQuery(...).jqGrid is not a function
- css and js on flask
- jquery get value of element
- Convert JS date time to SQLSERVER datetime
- reactjs app change port
- jquery multiple selectors
- nodejs cache data
- how to delete everything from a folder in js
- (not in PATH env variable)
- angular add object to array
- how to deap clone an object in javascript
- loop in javascript
- .index of javascript
- npm md to html
- jquery order by specific order
- jstree select all visible node only
- import leaflet js
- create array javascript fill
- js set visibility
- how to get the all input element id value using jquery