Closed Thread Icon

Preserved Topic: DHTML page (Is it possible) (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18047" title="Pages that link to Preserved Topic: DHTML page (Is it possible) (Page 1 of 1)" rel="nofollow" >Preserved Topic: DHTML page (Is it possible) <span class="small">(Page 1 of 1)</span>\

 
CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 08-17-2001 15:31

Before I start I have to say that I have not had that much sleep so if I don't make sense I appologize.


I am making a page that will act as a "flip book". Simple enough. However, is it possible to have just one page and depending on which link was clicked, determines which pictures are shown in the the flip book?

Thanks,
C:\

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-17-2001 16:03

Well, say you've got your pictures like this. one animation has these pictures:

jump0.jpg
jump1.jpg
jump2.jpg
... etc ...

and another animation has these pictures:

fall0.jpg
fall1.jpg
fall2.jpg
... etc ...

You can link to the page that displays these like this:

<a href="...etc.../mypage.html?animation=jump">go</a>
<a href="...etc.../mypage.html?animation=fall">go</a>

When the animating page loads, the stuff that's in the question mark and after will be stored in the variable window.location.search. So you can do this:

var allAnimationImages = new Array();
for (a=0; a < numimages; a++)
{
allAnimationImages[a] = new Image;
allAnimationImages[a].src = location.search.substr(11); + a + ".jpg";
}

That location.search.substr(11) takes everything in the string at the eleventh character and beyond. In this case, location.search will be something like "?animation=jump" and the eleventh character and beyond will be "jump."

Uh, maybe it should be the 12th and not the 11th. Experiment and see what works - I forget if the first character is zero or one.

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 08-17-2001 17:58

Thanks Slime. I will give it a shot and see if I can get it going.

C:\

« BackwardsOnwards »

Show Forum Drop Down Menu