Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: More than one Gif Player on a web page

  1. #1
    Join Date
    Jan 2016
    Posts
    23
    Thanks
    49
    Thanked 3 Times in 2 Posts

    Default More than one Gif Player on a web page

    Thank you firstly Beverlyh for your Animated Gif Player script http://www.dynamicdrive.com/forums/e...duce-page-load It is just what I was looking for.

    What I wanted to ask is how can I have more than one script on the page for Gifs that have different filenames?

    Do I need to use the script block multiple times at the bottom of the page, for every time a new Gif Player loads?

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    No that isn't necessary. Just include the one complete block of script (everything between the <script> ... </script> tags from the demo page http://fofwebdesign.co.uk/template/_...gif-player.htm) and it will work will multiple GIF Player markup instances.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. The Following User Says Thank You to Beverleyh For This Useful Post:

    Ripsaw (01-03-2016)

  4. #3
    Join Date
    Jan 2016
    Posts
    23
    Thanks
    49
    Thanked 3 Times in 2 Posts

    Default

    Thanks for replying.

    But if the script block is only used once, I'm not certain how I should make it 'talk' to the script so that it sees different Gifs. Do I put all the my-animation.gifs (and it's right hand png) into different folders or will the script just 'know'?

  5. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    You can put all of your gif and png files into different folders if the structure makes it more logical for you but you can also put them all in to the same folder if the are related - the script will know what to do.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  6. The Following User Says Thank You to Beverleyh For This Useful Post:

    Ripsaw (01-03-2016)

  7. #5
    Join Date
    Jan 2016
    Posts
    23
    Thanks
    49
    Thanked 3 Times in 2 Posts

    Default

    I'm a little confused. If all the files are called 'my-animation.gif' I won't be able to upload them in the same folder. I guessed I was suppose to upload to different folders to get around this problem. Have I misunderstood?

  8. #6
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Ok I think I see where the confusion came from. The tutorial and demo both reference files called "my-animation.png" and " my-animation.gif", but these are just examples. They can actually be called anything as long as they stay in their gif and png same-name pairs. So you could have;

    - "cat.png" and "cat.gif"
    - "hamster.png" and "hamster.gif"
    - "playing-football.png" and "playing-football.gif"

    All they can all be saved into the same folder.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  9. The Following User Says Thank You to Beverleyh For This Useful Post:

    Ripsaw (01-03-2016)

  10. #7
    Join Date
    Jan 2016
    Posts
    23
    Thanks
    49
    Thanked 3 Times in 2 Posts

    Default

    Ok thank you. Just curious but where in the script makes this possible?

  11. #8
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    That would be the lines that look like this;
    Code:
    img.src.replace(/\.[^/.]+$/, "") + '.gif';
    the expression in the brackets takes the file name (any file name) and then changes the extension to a gif or png depending on whether its playing or stopping the animation in the player.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  12. The Following User Says Thank You to Beverleyh For This Useful Post:

    Ripsaw (01-03-2016)

  13. #9
    Join Date
    Jan 2016
    Posts
    23
    Thanks
    49
    Thanked 3 Times in 2 Posts

    Default

    Excellent. Thank you again and great work on this awesome script!

  14. #10
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    No problem. You're welcome
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  15. The Following User Says Thank You to Beverleyh For This Useful Post:

    Ripsaw (01-03-2016)

Similar Threads

  1. Resolved Google audio player or another mp3 player
    By mlegg in forum Looking for such a script or service
    Replies: 10
    Last Post: 11-29-2011, 12:24 AM
  2. use Quicktime player instead of Flash mp3 player
    By salman1karim in forum Flash
    Replies: 10
    Last Post: 09-14-2011, 12:08 PM
  3. web page player required
    By gurmeet in forum PHP
    Replies: 2
    Last Post: 12-10-2010, 05:43 PM
  4. Pop up mp3 player
    By Struggle in forum Flash
    Replies: 0
    Last Post: 08-24-2010, 07:19 PM
  5. SWF player...
    By amsr in forum Flash
    Replies: 1
    Last Post: 04-20-2007, 04:06 PM

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
  •