Solved

'Document Gallery' Script to loop through Word or HTML Documents

Posted on 2007-03-27
1
188 Views
Last Modified: 2010-04-16
I have a folder that has 25 documents in it.  (I can have them as Word, or HTML)  

I need a script/code that will act just like an image gallery would work, but it would display each file, online for a specified amount of time, then go to the next.  

I would like this to loop indefinitely.  

JavaScript or ASP would be best for me....I have no experience with Perl.  

Thanks!!!
0
Comment
Question by:tmhechler
[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
1 Comment
 
LVL 1

Accepted Solution

by:
veiko_1001 earned 500 total points
ID: 18806822
To display the pages online, it would be best if you use HTML. Create an <IFRAME> on your page where you will load the content, start with a blank page:

<iframe id="myContent"></iframe>

Then you can create a loop function to load the page in Javascript which you can call periodically by using setInterval():

<script>

// set up list of images
var pagesArray = new Array()
pagesArray [0]="page1.html";
pagesArray [1]="page2.html";
pagesArray [2]="page3.html";

// start counter
var x = 0;

function loadNewPage()  {

// load image
document.getElementById("myContent").src = pagesArray[x]

// increment counter
x++;

// when at the end, start again
if(x==pagesArray.length) x=0;

}

</script>

And add the following code to the body tag:

<body onload="javascript: setInterval('loadNewPage()',5000);">

where 5000 is the time between the calls to the function in ms (In this case, 5 seconds).


Hope this helps...
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio‚Ķ
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil‚Ķ
The viewer will learn how to dynamically set the form action using jQuery.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

696 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