Solved

GIF ANIM "Restart" and ONLOAD consistency

Posted on 1998-07-31
4
4,477 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

630 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