Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Scroll To Top

const goToTop = () => window.scrollTo(0, 0);

goToTop();
Comment

scroll to top

onActivate(event) {
   // window.scroll(0,0);

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

    //or document.body.scrollTop = 0;
    //or document.querySelector('body').scrollTo(0,0)
    ...
}
Comment

scroll to top

	$("#scroll_icon").click(function()
	{
		jQuery('html,body').animate({scrollTop:0},2000);
	})
Comment

Scroll To Top

const scrollToTop = (element) =>
  element.scrollIntoView({ behavior: "smooth", block: "start" });
Comment

scroll to top

scrollto top
Comment

scroll top


$(document).ready(function(){
    $(".scroll-top").click(function() {
        $("html, body").animate({ 
            scrollTop: 0 
        }, "slow");
        return false;
    });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: convert currency to string javascript 
Javascript :: angular jspdf 
Javascript :: is function javascript 
Javascript :: javascript currency format 
Javascript :: countdown timer javascript stack overflow 
Javascript :: get file extension nodejs 
Javascript :: error metro bundler process exited with code 1 react native 
Javascript :: jquery div onload function 
Javascript :: postman response xml json xml2Json 
Javascript :: Iterate object using ngFor in angular 
Javascript :: dynamodb get all items nodejs 
Javascript :: vue call method after render 
Javascript :: cypress check element have attribute 
Javascript :: how to set the development mode in webpack 
Javascript :: react native making bigger hitbox 
Javascript :: javascript execute powershell script 
Javascript :: javascript remove query string from url 
Javascript :: how to rotate an array in javascript 
Javascript :: how to use console.log in vuejs 
Javascript :: Converting string to json object 
Javascript :: promise.race 
Javascript :: javascript time 
Javascript :: how to export a constant in javascript 
Javascript :: what is functional composition 
Javascript :: select field in react native 
Javascript :: storing an image file into buffer field with mongoose 
Javascript :: mui date picker width 
Javascript :: run a local instance of Kibana on docker and connect to elasticsearch 
Javascript :: node js and react js difference 
Javascript :: Map and Filter methods used together 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =