Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Auto scroll webpage then update page

Posted on 2012-12-22
2
Medium Priority
?
896 Views
Last Modified: 2012-12-23
hi - I'm using the following code below.  After the page is done scrolling I need to change to a different page.  I'm not sure how to determine when the page has finished scrolling.  I can use something different if needed.

Thanks!!

 
<script type="text/javascript">

function pageScrollPause() {
  window.setTimeout(pageScroll,6000)
}

function pageScroll() {
    document..scrollBy(0,1);
    scrolldelay = setTimeout('pageScroll()',10);
}
</script>

Open in new window

0
Comment
Question by:zack4x4
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 total points
ID: 38716345
try this:
var savpos = -1;
function pageScroll() {
    scrollBy(0,1);
		if (savpos == document.body.scrollTop) { // didn't scroll - end reached

			// TODO: redirect
			// window.location.href = '...';

			// to test, show alert
			// alert('done');

		} else {
			savpos = document.body.scrollTop;
			scrolldelay = setTimeout(pageScroll,10);
		}
}

Open in new window

0
 
LVL 4

Author Closing Comment

by:zack4x4
ID: 38717640
That worked great thanks!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question