Avatar billede skov55 Nybegynder
19. september 2002 - 23:36 Der er 1 kommentar

Vidrestilling efter nedtælling

Hej, jeg har lavet en hjemmeside som skal "launches" fredag d. 27 kl 2400 og derfor har jeg på hjemmesiden lavet en "countdown". Så ville jeg høre om der er nogen der har et script så siden automatisk vidrestilles til en anden side når dato, klokkoslettet opnåes ?? Hjemmesiden er: www.lyngvej.dk og koden til detællingen er:

<!--

//    Script Editor:  Howard Chen
//    Browser Compatible for this script: IE 2.0 or Higher
//                                        Netscape 2.0 or Higher
//    Get more JavaScripts at http://www.geocities.com/SiliconValley/Network/7432/
//    Bug report to hchen007@geocities.com
//    This script is free as long as you keep its credits

var theDay = new Date("September 29, 2002")  //The day has to be in the format Month Day, Year

var DayTill    //The string that is going to put all numbers together and make sense.

function countdown()

{

var today = new Date()    //Create an Date Object that contains today's date.

var second = Math.floor((theDay.getTime() - today.getTime())/1000)

var minute = Math.floor(second/60)  //Devide "second" into 60 to get the minute

var hour = Math.floor(minute/60)  //Devide "minute" into 60 to get the hour

var day = Math.floor(hour/24)  //Devide "hour" into 60 to get the day

CDay= day    //Correct day

CHour= hour % 24    //Correct hour, after devide into 24, the remainder deposits here.

CMinute= minute % 60    //Correct minute, after devide into 60, the remainder deposits here.

CSecond= second % 60    //Correct second, after devide into 60, the remainder deposits here.

DayTill =  CDay + " days, " + CHour + " hours, " + CMinute + " minutes and " + CSecond + " seconds "

//Rewrite the string to the correct information.

document.clock.countdown.value = DayTill //Make the particular form chart become "Daytill"

var counter = setTimeout("countdown()", 1000)

}

//-->

</SCRIPT>



<!-- -->    <! You must have countdown() here to run the script -->

</b></font>

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<hr noshade size="1" color="#C0C0C0" width="60%">
<p align="center" style="word-spacing: 0; margin-top: 0; margin-bottom: 0"><img border="0" src="file:///D:/Skov/Web/launch.JPG" width="559" height="110"></p>

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0"><b><font face="Verdana" size="7">

<!-- --></font></b><FORM NAME = "clock">

<p align="center" style="word-spacing: 0; margin-top: 0; margin-bottom: 0"><b><font face="Verdana" size="1" color="#FFFFFF"><INPUT NAME= "countdown" SIZE= "48" style="font-family: Verdana; font-size: 8 pt; font-weight: bold; color: #FFFF00; background-color: #443F3D; text-align: center; border: 1 dotted #FFFFFF"> 
</font></b>

</FORM><!-- -->
Avatar billede whatever Nybegynder
19. september 2002 - 23:57 #1
Prøv dette:

<html>

<head>
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>..:: LAUNCH DATE ::..</title>
</head>

<body onLoad="countdown()" bgcolor="#443F3D">

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0"><font face="Verdana" size="1"><b>&nbsp;<!-- --><SCRIPT>

<!--

//    Script Editor:  Howard Chen
//    Browser Compatible for this script: IE 2.0 or Higher
//                                        Netscape 2.0 or Higher
//    Get more JavaScripts at http://www.geocities.com/SiliconValley/Network/7432/
//    Bug report to hchen007@geocities.com
//    This script is free as long as you keep its credits

var theDay = new Date("September 29, 2002")  //The day has to be in the format Month Day, Year

var DayTill    //The string that is going to put all numbers together and make sense.

function countdown()

{

var today = new Date()    //Create an Date Object that contains today's date.

var second = Math.floor((theDay.getTime() - today.getTime())/1000)

var minute = Math.floor(second/60)  //Devide "second" into 60 to get the minute

var hour = Math.floor(minute/60)  //Devide "minute" into 60 to get the hour

var day = Math.floor(hour/24)  //Devide "hour" into 60 to get the day

CDay= day    //Correct day

CHour= hour % 24    //Correct hour, after devide into 24, the remainder deposits here.

CMinute= minute % 60    //Correct minute, after devide into 60, the remainder deposits here.

CSecond= second % 60    //Correct second, after devide into 60, the remainder deposits here.

DayTill =  CDay + " days, " + CHour + " hours, " + CMinute + " minutes and " + CSecond + " seconds "

//Rewrite the string to the correct information.

document.clock.countdown.value = DayTill //Make the particular form chart become "Daytill"

var counter = setTimeout("countdown()", 1000)

// Hvis dag, timer, minutter og sekunder alle er 0 eller mindre skiftes der side
if ((CDay <= 0) && (CHour <= 0) && (CMinute <= 0) && (CSecond <= 0)) {
    // SÆT DEN NYE SIDE HER!!!
    location.href='http://jubii.dk';
}

}

//-->

</SCRIPT>



<!-- -->    <! You must have countdown() here to run the script -->

</b></font>

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">&nbsp;

<hr noshade size="1" color="#C0C0C0" width="60%">
<p align="center" style="word-spacing: 0; margin-top: 0; margin-bottom: 0"><img border="0" src="file:///D:/Skov/Web/launch.JPG" width="559" height="110"></p>

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0"><b><font face="Verdana" size="7">

<!-- --></font></b><FORM NAME = "clock">

<p align="center" style="word-spacing: 0; margin-top: 0; margin-bottom: 0"><b><font face="Verdana" size="1" color="#FFFFFF"><INPUT NAME= "countdown" SIZE= "48" style="font-family: Verdana; font-size: 8 pt; font-weight: bold; color: #FFFF00; background-color: #443F3D; text-align: center; border: 1 dotted #FFFFFF"> 
</font></b>

</FORM><!-- -->

<hr width="60%" noshade size="1" color="#C0C0C0">

</body>

</html>
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester