Solved

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

Posted on 2007-03-27
1
185 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

810 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