/    Sign up×
Community /Pin to ProfileBookmark

Javascript Redirect After an Animated GIF

I would like to know if there is a way to have a page redirect its self to another page after an animated gif is played. I have seen stuff like this done using flash, but my flash skills arnt very good so I don’t know how to use it. Any help please?
Thanks

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@NedalsApr 12.2003 — You cannot use an animated gif to redirect or do anything else for that matter. Although not perfect, you could do something like this.

<script type="text/javascript">

<!--

// preload the images

var img = new image();

img.src = "animated.gif";

// timer set to 5 secs here (1000 per sec)

function init() { timer = setTimeout("redirect()",5000) }

function redirect { location.href = "newpage.html" }

onload = init;

//-->

</script>

The animated gif is preloaded. You can then set the time equal to (or greater than) the time it takes for your animated gif to perform. Then transfer to the new page.
×

Success!

Help @Kellenjb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...