Solved

GIF ANIM "Restart" and ONLOAD consistency

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

929 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

13 Experts available now in Live!

Get 1:1 Help Now