Solved

GIF ANIM "Restart" and ONLOAD consistency

Posted on 1998-07-31
4
4,464 Views
Last Modified: 2013-11-19
Well I'm planning on using GIF ANIM for a small sequence of my webpage.  I have JS code which will actually replace one graphic for this GIF ANIM using: document[grfx].src="p/anim.gif";

I am using imagemaps and so there are a few HREFS inside <AREA> tags which call javascript functions to handle the click.  Now when I click on these imagemap areas, the GIF ANIM stops animating.  Why is that and exactly how can I "restart" or even prevent this from happening to my GIF anim? I would like to have the GIF anim continuously running.  I tried making a second call to the frozen GIF ANIM via the same: document[grfx].src="p/anim.gif" but it never restarted.

And one last question, when I click around via the imagemaps I use ONLOAD to tell me when a graphic is completely finished displaying (I would have used .COMPLETE but it doesn't seem functional).  Sometimes (maybe when I click too fast or too often) the ONLOAD event isn't called.  In fact it seems completely turned off and non-functional.  Why does this happen and is there anything I can do to prevent this?

Thank you VERY much.
0
Comment
Question by:mirror
  • 2
4 Comments
 
LVL 8

Expert Comment

by:jbirk
ID: 1267541
Well, I'm not sure about onLoad with images because I haven't really played with that yet, but I might be able to help you with the animated gif part.  Could you post the trouble code on the web and post the url for it here?  That way I could look directly at it to figure out what's going on (it sounds kind of complicated and will be easier when seeing the actual code and graphics).
-Josh
0
 

Accepted Solution

by:
Visible_Man earned 50 total points
ID: 1267542
I've have an animating gif porgram that I use that works quite well at animated multiple images.  The program store all the images and coding info in the gif so after you made the  gif all you to do is put it up like a normal picture. It's really easy to use.  Goto the web page, read through it, and get the shareware version.

http://www.mindworkshop.com/alchemy/gifcon.html

Hope you like it :)
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1267543
mirror, you there?
I know how to make animated gifs play when they aren't looping now.  There are two ways.  One, you load them into image objects at pixel dimensions slightly off the dimensions you specified for the original image which is getting replaced.  When you do this, it has to resize the image every time and therefor refreshes it and starts playing it back at the beginning.

The other way is to change:
document[grfx].src="p/anim.gif"
to:
document[grfx].src="p/anim.gif#"
I know it sounds wierd but it works!

Try these out and see if they will help you.
-Josh
0
 
LVL 14

Expert Comment

by:ThG
ID: 11330304
> document[grfx].src="p/anim.gif#"
> I know it sounds wierd but it works!

jbirk, I can't believe this, it really WORKS!

I had an animated GIF to start onmouseover, and I had it preloaded in a imgs javascript array.
When the event triggers, I replace target_img.src with imgs[n].src
With jbirk's fix now I can do:
target_img.src = imgs[n].src + '#';
...and it restarts the gif animation! This was tested on IE 5 and Mozilla 1.6

Thank you.

ThG
EE Page Editor, PHP channel
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
This article discusses how to create an extensible mechanism for linked drop downs.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

757 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

20 Experts available now in Live!

Get 1:1 Help Now