sleep Topic is solved

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
gtron

sleep

Post by gtron » Mon Oct 29, 2007 7:34 pm

is there a way to pause or have a page sleep before loading?

i want to do something like...

Code: Select all

<script type="text/javascript">
if (location.hash)
{
sleep 5000;
}
</script>


that way if someone uses an anchor using jcebox the page will wait for the jcebox to load before loading the content.

thanks in advance

gtron

Re: sleep

Post by gtron » Mon Oct 29, 2007 9:04 pm

although it didnt fix the problem i'm having with jcebox, i figured out one way of doing it so if anyone ever needs to do this here ya go. ..

in the content item:

Code: Select all

<script type="text/javascript">
if (location.hash !== "")
{
document.write("including sleep.php")
document.write("{jumi [includes/sleep.php]}")
}

</script>


sleep.php

Code: Select all

<?php
#Simple sleep timer by gtron.com
#Pass timer (/sleep.php?timer=10) to specify time otherwise 3 seconds is the default.

$sleepTime = $_POST['timer'];

//default sleep time of 3 seconds
if (!$sleepTime)
{
   $sleepTime=3;
}

//sleep
sleep($sleepTime);

?>


requires jumi extension.

sorry if my code sucks, i work in threat & vulnerability and im not a developer.

on that note, anyone know how i can get the jcebox to load anchors right? lol


Post Reply