Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-03-27
1
Medium Priority
?
193 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 2000 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

A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

670 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