View Full Version : Delayed Redirect Script for Image Hosting site
lostgot
Oct 30th 2008, 3:08 am
Im Currently looking for a script which dealys the opening of the Image page by 5 seconds.
Example:
A user clicks on the thumbnail of the image---->The Landing page must show "Please wait while the image loads......" ------>(after 5secs)--->Opens the original full size image page.
How can this be done..?
ads2help
Oct 30th 2008, 5:13 am
you must have a function that redirects. An example :
function redirect(reference) {
// replace with your view image file
location.href = 'image.php?id='+reference
}
function delayed_redirect(reference) {
setTimeout('redirect(reference);',5000) // 5000 milliseconds = 5 secs
}
in your file that display the image:
<img src="link_to_image.gif" title="Thumbnail of bla bla" onclick="delayed_redirect(REFERENCE_TO_YOUR_PICTURE)" />
The REFERENCE_TO_YOUR_PICTURE may be the picture's ID? or anything that you need to tell your scripts to display the image.
VishalVasani
Oct 30th 2008, 5:29 am
Javascript Function setTimeout Is useful for You....
bilawal360
Nov 1st 2008, 12:28 pm
Usually setTimeout() is common for javascript but a majority of people who don't have javascript meaning you'd have to use <meta http-equiv='refresh'...> for your <noscript>. I know this is irrelevant for javascript, but it's useful to have support for people who don't use javascript because there is a LOT of negatives for javascript.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.