Solved

GIF ANIM "Restart" and ONLOAD consistency

Posted on 1998-07-31
4
4,468 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

785 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