Solved

Play an animated.gif on page load.

Posted on 2001-07-13
9
308 Views
Last Modified: 2008-03-06
I want to play a "shockwave" file or animate gif, then once it completes automatically load the next page.  That way someone looking (or watching) doesn't have to push a link to go in.
0
Comment
Question by:ambulance
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 7

Expert Comment

by:RBertora
Comment Utility
Suggestion :Use
  setTimeout(expression, msec)    

to wait until your animation is finished playing, all you need to know is how long it takes to play your image.. and then feed in the time in milliseconds.. I have used 5 seconds here:


<script language="javascript">
 function WitForIt()
  {
     document.location = 'Nextpage.htm'
       }
</script>

<body onload="setTimeout(WitForIt(), 5000)">


regards,
Rob.
0
 
LVL 3

Expert Comment

by:davlun20080
Comment Utility
If you are going to use shockwave or flash, then you can add code to the shockwave or flash file to call a function that will reload the page for you, with the correct url.

This way your users will always see the whole thing without you having to worry about getting the length of your animated gif correct.  This may be a concern if you have a complicated animation, older computers can play it slower, making the timing a little bit off.

If simple animation, time it and use the script RBertora gave you above.
0
 

Author Comment

by:ambulance
Comment Utility
On load, how do I get the shockwave or gif to play automatically?

Once I can figure out how to get it to play right away, I think the script will work.

Thanks for your help!
0
 
LVL 3

Accepted Solution

by:
davlun20080 earned 50 total points
Comment Utility
Shockwave and flash have settings that need to be activated when you are building the file for the server.  Once set, they will activate the play for you all by themselves.

Animated GIF's will play automatically as well, once you load the page (or they should)
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:ambulance
Comment Utility
Okay, thanks. I'll try all of your ideas and get back to you.
0
 

Expert Comment

by:rongreen
Comment Utility
You don't really need the setTimeout. Use the meta refresh.
<html><head>
<META http-equiv="Refresh" content="10;URL=http://www.experts-exchange.com/">
. . .
</head>
<body>
. . .
<img src="your-animated image.gif" width=". . ." height=". . . " border="0" alt="">
. . .
</body>
</html>


Will allow your animation to play for 10 seconds then redirect to Experts Exchange.

And as stated earlier use Shockwave/Flash controls to redirect the viewer. (Although the <meta> tag should work for Flash as well.)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to davlun20080

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 

Expert Comment

by:SpideyMod
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now