Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-31-2002, 01:41 AM   PM User | #1
alphawolf
New Coder

 
Join Date: Jul 2002
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
alphawolf is an unknown quantity at this point
animated .gif that freezes with script use

I am using an animated .gif img as a link on a page that has quite a few different scripts running on it. (See link below)
All runs smoothly, until function "hideTip2" is called. (Click on the right-hand-most purple flower, then close the pop-up using the leaf.) As the pop-up closes, the .gif img freezes. Why? And does anyone know what I might do to prevent it from happening?

Many thanks

Click for prototype page
__________________
"The world is a very confusing place..."
alphawolf is offline   Reply With Quote
Old 07-31-2002, 02:08 AM   PM User | #2
HappyDude
New Coder

 
Join Date: Jul 2002
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
HappyDude is an unknown quantity at this point
Your page seems to generate a lot of javascript errors...

But aside from that,
I don't know why gifs sometimes freeze during certain scripts, but I've seen it happen before... I also don't know how to stop it from happening...
What I do know is a workaround you can use - simply have the browser reload the image. It should be fast and painless, as the image should already be in the browser's cache... all you have to do is add a bit to the onclick of the leaf to make it reload the image...
In the onclick, you would add something like:
document.getElementById('p0').src=document.getElementById('p0').src
HappyDude is offline   Reply With Quote
Old 07-31-2002, 06:13 AM   PM User | #3
RoyW
Regular Coder

 
Join Date: Jun 2002
Location: Atlanta, GA.
Posts: 313
Thanks: 0
Thanked 0 Times in 0 Posts
RoyW is an unknown quantity at this point
PHP Code:
<a href="[b]javascript[/b]:hideTip()"><img src="close.gif" border="0"></a
The above kind of link causes animated gifs to always stop because the browser thinks you are following a link so it stops all animations.

The correct way to do it is
PHP Code:
<a href="#" onClick="hideTip();return false"><img src="close.gif" border="0"></a
(The "return false" is important)
__________________
The answer does not come from thinking outside the box, it comes from realizing the truth :-
"There Is No Box". [JavaScript Gadgets'n'Gizmos][JavaScript-FX]
RoyW is offline   Reply With Quote
Old 07-31-2002, 11:04 AM   PM User | #4
alphawolf
New Coder

 
Join Date: Jul 2002
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
alphawolf is an unknown quantity at this point
RoyW, Thank you so much. That's sorted out my little bee really well!


Anyone else...?

HappyDude said that the page causes a lot of errors, but it works fine on my browser (IE5.5) which is the intended target.
How do I know if it's generating errors, and what can I do to avoid them when I find them?

(Click on link in first post to view prototype page)

Many thanks.
__________________
"The world is a very confusing place..."
alphawolf is offline   Reply With Quote
Old 08-01-2002, 03:18 AM   PM User | #5
HappyDude
New Coder

 
Join Date: Jul 2002
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
HappyDude is an unknown quantity at this point
I'm running IE 6.0...
The errors I'm getting are "'filters.alpha' is null or not an object"
In NS 6.2, I'm getting no errors, but a few of the effects cause the browser to go very choppy and freeze up now and then.
HappyDude is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:26 AM.


Advertisement
Log in to turn off these ads.