Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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 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)
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 …

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now