Forum Moderators: open

Message Too Old, No Replies

Trying to write a small script

         

Dpeper

12:37 am on Dec 11, 2005 (gmt 0)

10+ Year Member



Ok I am basically trying to create a page that is at

www.ExampleURL.com/abc?Page=1
and refreshes and goes through to pausing for a few seconds on each Kind of a slide show of pages
www.ExampleURL.com/abc?Page=2
www.ExampleURL.com/abc?Page=3
www.ExampleURL.com/abc?Page=4.... etc...

This is what I tried

url = www.ExampleURL.com/abc?Page=1
URLobj.item("Page").value = clng(URLobj.item("Page").value) + 1

Can any one help me out I normally dont do this kind of stuff but it seemed so simple that I thought I would be able to figure it out. I normally just find a script like what I want and change it but in this case I got no where to start!

Dpeper

12:39 am on Dec 11, 2005 (gmt 0)

10+ Year Member



Oh I have to do it in a frame to because I am essentially doing a slide show of a series of URLS that are dynamic only with the # changing of some one elses site. On a page of mine.

Dpeper

2:09 am on Dec 11, 2005 (gmt 0)

10+ Year Member



This is driving me nuts Ill pay some one $20 if they help me out on this!

Not kidding, I dont get it.

Dpeper

9:17 pm on Dec 11, 2005 (gmt 0)

10+ Year Member



Anyone?

Donny

kaled

12:34 am on Dec 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this, I think it's about right but I'm half asleep. There's probably a better way to initialize the array too.

var photoUrls = new array[3];
photoUrls[0] = 'photo1.jpg';
photoUrls[1] = 'photo2.jpg';
photoUrls[2] = 'photo3.jpg';

var photoTimer = setInterval('changePhoto()',5000);
var photoIndex = 0;

function changePhoto(){
top.fr_photo.location.replace(photoUrls[photoIndex++])
if (photoIndex >= photoUrls.Length) clearInterval(photoTimer)
}
// fr_photo is the name of the frame

Assuming the photos use sensible names, you could avoid using an array altogether and create the urls on the fly.

Kaled.

Dpeper

3:06 am on Dec 12, 2005 (gmt 0)

10+ Year Member



This is kind of where my problem comes in #1 I want it to rotate through litterally a thousand pages, so a script that starts at /Page=1 and then automatically counts up would be ideal.

The second problem is I am not dealing with images, I am dealing with entire web pages, that need to rotate through.

Dpeper

4:44 am on Dec 12, 2005 (gmt 0)

10+ Year Member



So been working on this and figured i would post my work incase any one ever needs anything similar this is what I got so far, still lost on how to do the +1 to a preset defined URL.

<html>
<head>

<script language="javascript">
var urls;
var order = 0;
var mywin;
function rotate()
{
if( order < urls.length - 1 )
order++;
else
order = 0;
mywin.location = urls[order];
setTimeout('rotate();', document.getElementById("time").value*1000);
}

function init()
{
if( document.getElementById("urls").value.length!= 0 )
{
urls = document.getElementById("urls").value.split(",");
mywin = window.open(urls[0], '87931', 'width=' + screen.availWidth + ', height=' + screen.availHeight + ', screenX=0, left=0, screenY=0, top=0, toolbar=1, scrollbars=1, location=1, status=1, menubar=1, resizable=1');
mywin.focus();
setTimeout('rotate();', document.getElementById("time").value*1000);
}
else
{
alert("No url's here");
}
}
</script>
</head>
<body>
URL's: <textarea id="urls" name="urls" rows="5"
cols="40"></textarea> (Comma Separated Variable format with full url,
like 'http://www.google.com/')<br>
Time: <input type="text" id="time" name="time"> (seconds)<br>
<input type="button" value="Visit" onclick="init();">
</body>
</html>