SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    animated gif and JS

    There is JS menu on page and animated gif.
    When we click on menu, animated gif will stop.

    They don't have any dependencies.
    What it should be?

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your links use something like this

    <a href="java script:someaction()">

    or

    <a href="#" onclick="someaction()">

    That will halt the gifs.

    http://developer.irt.org/script/1751.htm
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can use an image swapping function, and get it to change to the still image.

    I have changed my animated gifs to swapping images using a timeline or setTimeout functions.
    It uses less memory and less frames, and you have more control. You can also animate parts of a picture. I am building an animation at www.unitingrhythms.co.uk/didjs/circular.html which, done as animated gif would need 40-50 frames, but using this method I only have 10-15 images, all smaller than the actual picture.

    to set it up, start a counter,
    counter=0
    function count() {
    counter++
    ......functions here......
    setTimeout('count()',time in milliseconds) }

    and use functions like;
    if(counter=20) { swapimage("image1",nextImageSrc) }
    you'll find it will download loads faster, and you can vary the speed as well........

    hope its helpful


    and......someone try nicking my pic......it'll take a while
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


Bookmarks

Posting Permissions

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