making loops

  • BenitoCamelaxxx
  • Newbie
  • Newbie
  • BenitoCamelaxxx
  • Posts: 9

Post 3+ Months Ago

:) :D 8) :wink:

Hi there, I've got a question, hope you can help me, I don't think its a hard one ... anyways .. I've got a gif on my webpage, but after a certain time it stops moving, which is normal, what I'd like is that it didnt stop moving, is there any way to do that?

Code: [ Select ]
<p align="right"> &nbsp;&nbsp; <a href="mailto:my@email.add?Subject=My Subject"> <img border="0" src="my_pic.gif" width="132" height="103"></a></p>


looking forward to your answers :idea: :idea: :idea:
thx a bunch

-----------------------------
BE TRUE TO YOURSELF
  • darkthroniar
  • Beginner
  • Beginner
  • User avatar
  • Posts: 42
  • Loc: Los Angeles, CA

Post 3+ Months Ago

Hi..

Open the .gif file in a gif editor like ImageReady and modify to loop

:)
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23454
  • Loc: Woodbridge VA

Post 3+ Months Ago

Just an FYI, even though darkthroniar's advice will get the result you want, you should know that as soon as I hit the ESC button on my keyboard, your gif animation will stop. And since I find animated gifs annoying and distracting, that's the first thing I do when I come to a page that has them.

If you've never seen what I'm talking about just go to the OZZU main page and scroll to the bottom of the screen where there are animated gifs. Then hit ESC.
  • katana
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2391
  • Loc: Edinburgh, Scotland

Post 3+ Months Ago

Wow ATNO/TW, I never knew that! Thanks! You really do learn something new everyday...
*off to find a page with loads of animated GIFs just so he can press the 'ESC' button and chuckle to himself*
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

ATNO.... you're going to hate me :lol:
This example for restarting the animation when ESC is pressed only works in IE as far as I know.
Attack of the undead GIF

BenitoCamelaxxx the outerHTML method in this example could be modified with a setInterval to loop your image.
Here's the source of that example,
Code: [ Select ]
<html><head><title>GIF Zombie</title>
<script language="javascript">

function GIFzombie(theKey){
if(theKey == 27){
  document.getElementById("g").outerHTML = document.getElementById("g").outerHTML;
}
}

</script>
</head>

<body onKeypress="GIFzombie(event.keyCode);">
<div align="center">Go ahead, press ESC.
<br><br>
<a href="http://www.bigwebmaster.com"><img src="banner22.gif" id="g"></a>
</div>
</body>
</html>
  1. <html><head><title>GIF Zombie</title>
  2. <script language="javascript">
  3. function GIFzombie(theKey){
  4. if(theKey == 27){
  5.   document.getElementById("g").outerHTML = document.getElementById("g").outerHTML;
  6. }
  7. }
  8. </script>
  9. </head>
  10. <body onKeypress="GIFzombie(event.keyCode);">
  11. <div align="center">Go ahead, press ESC.
  12. <br><br>
  13. <a href="http://www.bigwebmaster.com"><img src="banner22.gif" id="g"></a>
  14. </div>
  15. </body>
  16. </html>

To loop it you can take the "if" condition out of the GIFzombie function, & use setInterval with the number of seconds it takes for the image to stop.
  • katana
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2391
  • Loc: Edinburgh, Scotland

Post 3+ Months Ago

Quote:
Only works in IE as far as I know.

Works in Firefox...
  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2194
  • Loc: Canada

Post 3+ Months Ago

No it doesn't...
I think his script makes the ESC key NOT function; in Firefox the image stops looping.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 20 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.