Scroll To Top Of Page Using jQuery

Hi Guys,
The scroll to top is very important feature in web development. Many web site provide this functionality. The content of a web page exceeds and visitors scroll down the web page, then having a button to smooth scroll to the top of the page is a good idea. In many websites with scroll to top feature so that their visitors can easily navigate to top section of website with one click. The scrollTop() method sets or returns the vertical scrollbar position for the selected elements. This feature is really helpful in websites, having long length pages.



We can implement this Scroll to top of page using jQuery. You can simply reference to the top of the page. But it’s not good look. So, we use jQuery animated function for good looking to make the scrolling easy and smooth. This feature is very easy to create and implement.

Page Content

  • jQuery
  • HTML

demo




Step 1:

Adding jQuery to a page. This code is included into the head tag of your html document.

		

This will tell the browser to load jQuery from Googles server when your page is loaded.

Step 2 :

		




This is the link or button that will take the user to the top when clicked.

Step 3:

Adding CSS style into your page in style tag.

	




Step 4: The main part is of jQuery code is:

The scroll to top functionality described here.


The jQuery code is checking if the value of the page scrolled down is greater than 100 then fadeIn() the button, when the button is clicked then scroll the page to the top and fadeOut() then button.

Step5: HTML Code is:

The HTML part is used for web site page content.

	
		
		

You have created your registration.php page successfully then its time to move ahead and learn how to create login page in PHP. For performing this operation using fordemo database and finforex_users table in login page. This login script will take username and password entered by user through login.php page. The encryption password (MD5) is used here. Then it will match that username and password combination in database and when it finds then it check the role of the corresponding user and that combination exists in table it will allow user to login to corresponding page else it will show appropriate error message.

If you want to run the same code over and over again, each time with a different value. Loops can execute a block of code a number of times. There are mainly four types of loops in JavaScript. for : loops through a block of code a number of time. while : loops through a block of code while a specified condition is true do/while : also loops through a block of code while a specified condition is true

You have created your registration.php page successfully then its time to move ahead and learn how to create login page in PHP. For performing this operation using fordemo database and finforex_users table in login page. This login script will take username and password entered by user through login.php page. The encryption password (MD5) is used here. Then it will match that username and password combination in database and when it finds then it check the role of the corresponding user and that combination exists in table it will allow user to login to corresponding page else it will show appropriate error message.

If you want to run the same code over and over again, each time with a different value. Loops can execute a block of code a number of times. There are mainly four types of loops in JavaScript. for : loops through a block of code a number of times while : loops through a block of code while a specified condition is true do/while : also loops through a block of code while a specified condition is true.

I share somany article related to web development. Many people use my article for their professional growth. I got many tutorial requests from my readers related to web development using php, wordpress, mysql, ajax, jquery, javascript etc. From their request, one of my readers asked to me “ how to design facebook style background image upload and position adjustment using web development technology.” After along study, I using Ajax and jQuerymethod for developing this application. I have been published many tutorials related ajax image upload. This one is something different and very interesting. Table of Content:MySQL table, HTML or PHP,JavaScript,Ajax,CSS and MySQL table. The MySQL table used for storing user details to database. Here I use user table for this operation.

Full code


    
		
		Scroll to Top Using jQuery - PrittyTimes
		
		
		
	
	
		
		

You have created your registration.php page successfully then its time to move ahead and learn how to create login page in PHP. For performing this operation using fordemo database and finforex_users table in login page. This login script will take username and password entered by user through login.php page. The encryption password (MD5) is used here. Then it will match that username and password combination in database and when it finds then it check the role of the corresponding user and that combination exists in table it will allow user to login to corresponding page else it will show appropriate error message.

If you want to run the same code over and over again, each time with a different value. Loops can execute a block of code a number of times. There are mainly four types of loops in JavaScript. for : loops through a block of code a number of time. while : loops through a block of code while a specified condition is true do/while : also loops through a block of code while a specified condition is true

You have created your registration.php page successfully then its time to move ahead and learn how to create login page in PHP. For performing this operation using fordemo database and finforex_users table in login page. This login script will take username and password entered by user through login.php page. The encryption password (MD5) is used here. Then it will match that username and password combination in database and when it finds then it check the role of the corresponding user and that combination exists in table it will allow user to login to corresponding page else it will show appropriate error message.

If you want to run the same code over and over again, each time with a different value. Loops can execute a block of code a number of times. There are mainly four types of loops in JavaScript. for : loops through a block of code a number of times while : loops through a block of code while a specified condition is true do/while : also loops through a block of code while a specified condition is true.

I share somany article related to web development. Many people use my article for their professional growth. I got many tutorial requests from my readers related to web development using php, wordpress, mysql, ajax, jquery, javascript etc. From their request, one of my readers asked to me “ how to design facebook style background image upload and position adjustment using web development technology.” After along study, I using Ajax and jQuerymethod for developing this application. I have been published many tutorials related ajax image upload. This one is something different and very interesting. Table of Content:MySQL table, HTML or PHP,JavaScript,Ajax,CSS and MySQL table. The MySQL table used for storing user details to database. Here I use user table for this operation.

If you have any query or any doubt then please feel free to ask.

Leave a Reply

Your email address will not be published. Required fields are marked *