We help IT Professionals succeed at work.

Refresh a portion of a page every 10 seconds

Bill Sullivan
on
211 Views
Last Modified: 2014-05-12
Hi Experts!
I'm trying to get some customer testimonials to "scroll" on the front page of my website by calling survey results from my database.  I would like these comments to scroll every 10 seconds.  Can you help me with the code to do this?  I've included the page I'm working on, and the lines I would like to refresh are found on lines 121 through 165.  Thanks for your help!
index.php
Comment
Watch Question

Daniel KlineSr. SharePoint Developer

Commented:
Use a JavaScript setTimeout() function to wrap the render code which selects the content to display during each interval.

https://developer.mozilla.org/en-US/docs/Web/API/Window.setTimeout

Author

Commented:
It appears that code would delay running the script for X seconds, but would not "refresh".  Am I missing how setTimeout() works?
CERTIFIED EXPERT
Expert of the Year 2014
Top Expert 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Daniel KlineSr. SharePoint Developer

Commented:
There are a lot of discussions on the Internet in how to use setTimeout and its sister setInterval.  The application you are describing is quite common.  See if this solves your problem without having to deal with recursive calls to setTimeout.

http://manos.malihu.gr/slidebox-jquery-banner-rotator/

Author

Commented:
Thank you so much!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.