Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with gif's on Internet Explorer

Status
Not open for further replies.

Luca200

Programmer
Jul 7, 2002
13
0
0
IT
I have a page in which there's a hidden 'div' containing a gif image that must appear when the user clicks on a button.
The matter is IE refuses to show the gif animation and freezes on the first frame. This happens only if I dynamically show the image: if I leave it appair on page load, I can normally see the animation.

Any workaround?

Thanks
 
Is the animated gif a looping one?

Does it freeze on the first or the last frame? I can imagine it freezing on the last frame - especially if the animation is "play once" or something.

How are you dynamically showing the image?

Have you tried Firefox to see if it works ok there first? And have you actually confirmed that the animated gif is actually working normally?

Post a URL or at the very least the code you have so far so we can see if it's anything simple.

Cheers,
Jeff


[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
I apologize if it was not too much clear, but I wrote 'freezes on the first frame' and meant 'the first frame', not the last one. :)
The animation is not 'play once', and Firefox works well.
I wrote I can see the animation if IE can load it inside the page instead of showing it dynamically, too.

The code is something like this
Code:
<input type="submit" onclick="showDiv()" />
<script type="text/javascript">
function showDiv() {
  var hiddenDiv = document.getElementById('hiddenId');
  hiddenDiv.style.visibility = 'visible';
}
</script>

Thanks :)
 
You are calling the showDiv() function from a submit button. So, are you submitting the page, or showing the div? I suggest changing to type="button" instead.

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
headbang.gif
[rockband]
headbang.gif
 
Could be you found the matter.
The image is nothing but a 'Please wait...' for large file uploads, so I'm actually submitting the page and showing the div at the same time. I'll try changing the button to a button type and making a 'submit()' just after showing the div.

Thanks!
 
I had a similar problem once... I successfully displayed my "please wait" dots, but they didn't animate in IE (this was on a form submission as well).

It was a long time ago, but from memory, I seem to remember not finding a solution that didn't involve frames, however (submitting to a different frame... or maybe the image was loaded in a different frame).

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Glad you have it under control Luca200 [smile]

As a side note... a huge number of people post questions here and they either have no clue about the problem, about the solution or anything in between. Usually these questions contain no code, no links and assume the reader knows exactly what the expected behaviour is.

I admit that I initially read your post as one of those.

I totally accept that I was in error - but I wouldn't change the way I answered your post. Instead of assuming you knew what you were doing (and wasting probably 30 mins of my time to-ing and fro-ing before finding out you were just starting the first chapter of "Dummies guide to Javascript") I chose to assume the exact opposite (and push you to take the time to provide the details that I would need to have answers to in order for me to solve the problem).

Maybe I should have just posted: "post your code" - but that would have been a LOT less helpful than the questions I asked... for each of those questions could have been the trigger you needed to solve the problem yourself - and they all offer potential directions for research to debug the problem.

... I feel that the way you replied in your post was rather petty and attempts to make me look like a fool... and I wanted to make it clear why I wrote my post the way that I did.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
@Dan
I'm afraid it's exactly like you say. As the form gets submitted, IE stops the animation.

@Jeff
I had understood the way you answered. Anyway I wouldn't change my second post, too, as your answer made me look like a fool.
I attend an italian IT forum and there, as you say, lots of people post - saying it in two words - dummy questions. Anyway I'm used to give people some credit, and if someone is speaking about a 'first frame' I do believe he's actually seeing the first frame until he clearly shows me he doesn't know what he says. And, if I feel like it could take too much of my time, maybe I will bypass that post. ;-) In simple words, I prefer to assume he knows what he's doing - just the opposite of what you do.
It's just a matter of different ways of acting. No problem anyway. :)

Cheers
Luca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top