Page scrolling up or down through javascript


Document or webpage scrolling is very easy through javascript.
window.scrollBy(10,20); // horizontal and vertical scroll increments or decrements.

Using scrollBy function you can create custom event or function based on project requirement.

Here I am giving you the sample code: Up scrolling and down scrolling
For Upscrolling:
function ScrollUp() {
window.scrollBy(0,100);
}

For Down scrolling:
function ScrollDown() {
window.scrollBy(0,-100);
}

In same way you can create your own functions.

Advertisements
This entry was posted in PHP and tagged by Purab Kharat. Bookmark the permalink.

About Purab Kharat

I am WordPress and Drupal Architect. I worked on many technologies like Ruby on Rails, Flex, PHP etc... I am Purab Kharat from India, Pune. I love to play chess and listen music and read books. I work in SY Smartsourcing Global Pvt Ltd in Princeton, NJ, USA. Now I am living at Plainsboro, 164 Hampshire Drive, Princeton Meadows, NJ. I have more then Ten years experience in Web Application Development (Specially in Php 5.0, Ruby on Rails, Mysql 5.0, RIA, Wordpress, Drupal, Joomla, Ecommerce)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s