Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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..."

  • #2
    New Coder
    Join Date
    Jul 2002
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Atlanta, GA.
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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]

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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..."

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •