C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Automatically scroll web page using Javascript


Posted Date: 26 Aug 2008    Resource Type: Code Snippets    Category: Javascript

Posted By: Nitin Kumar Sharma       Member Level: Silver
Rating:     Points: 10



This code sample shows how to scroll a webpage automatically using Javascript.


function pageScroll()
{
window.scrollBy(0,50); // horizontal and vertical scroll increments
scrolldelay = setTimeout("pageScroll()",100); // scrolls every 100 milliseconds
}


Call the above function on body onLoad :

<body onLoad="pageScroll()">


It will start scrolling of the page automatically, but if you want to stop scrolling try this :

function stopScroll()
{
clearTimeout(scrolldelay);
}

<a href="javascript:stopScroll()">Stop Scrolling</a>


That’s it.
Happy Programming !!




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Scrolling a page  .  Scroll a Page With JavaScript  .  How to Scroll a Page With JavaScript  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to print HTML page
Previous Resource: Get and Set position of a control using Javascript
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

silicone halloween mask

Contact Us    Privacy Policy    Terms Of Use