<SCRIPT type="text/javascript"><!-- // start hiding
//BigDay = new Date("January 1, 2000");
BigDay = new Date(2000,0,1);
msPerDay = 24 * 60 * 60 * 1000 ;
var id,pause=0, position=0;
function showtime() {
today = new Date();
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
tdays = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
}
function Liczebnik( ile, rdzen, konc1, konc2, konc5 ) { // Autor Romuald Zylla
var N0, N1, N2, R0;
N0 = Math.floor( Math.abs( ile ) ); // funkcja ma sens dla liczb całkowitych
N1 = N0 % 10;
N2 = N0 % 100;
R0 = konc1;
if (N0 == 1) R0 = konc1
else if ((N2 > 4) && (N2 < 22)) R0 = konc5
else if ((N1 > 1) && (N1 <= 4)) R0 = konc2
else R0 = konc5;
return rdzen + R0;
}
function imascroller() {
// variables declaration
var i, k;
showtime();
// Prosze zwrocic uwage na uzycie funkcji Liczebnik do generowania koncowek
var msg= " "+Liczebnik( daysLeft, "Został"," ","y ","o " ) +
daysLeft+Liczebnik( daysLeft, " ","dzien, ","dni, ","dni, " ) +
hrsLeft +Liczebnik( hrsLeft," godzin", "a","y","" ) +" i "+
minsLeft+Liczebnik( minsLeft," minut", "a ","y "," " )+" do roku 2000!"+
" ";
// increase msg
k=(150/msg.length)+1;
for(i=0;i<=k;i++) msg+=" "+msg;
// show it to the window
document.forms[0].imascroller.value=msg.substring(position,position+300);
// set new position
if (position ++== 300) position = 0;
// repeat at entered speed
id = setTimeout( "imascroller()", 200 );
}
// End Hiding Here -->
</script>
Na poczštku w znaczniku BODY należy jeszcze dodać
<body onload="imascroller()">
W ciele strony należy dodać wywołanie okienka z tekstem
<form ID="form2" action=get>
<input type="text" name="imascroller" size="60" value="">
</form>
<SCRIPT type="text/javascript"><!-- // start hiding
//BigDay = new Date("March 28, 2004");
BigDay = new Date(2000,0,1);
msPerDay = 24 * 60 * 60 * 1000 ;
var id,pause=0, position=0;
function showtime() {
today = new Date();
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
tdays = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
}
function Liczebnik( ile, rdzen, konc1, konc2, konc5 ) { // Autor Romuald Zylla
var N0, N1, N2, R0;
N0 = Math.floor( Math.abs( ile ) ); // funkcja ma sens dla liczb całkowitych
N1 = N0 % 10;
N2 = N0 % 100;
R0 = konc1;
if (N0 == 1) R0 = konc1
else if ((N2 > 4) && (N2 < 22)) R0 = konc5
else if ((N1 > 1) && (N1 <= 4)) R0 = konc2
else R0 = konc5;
return rdzen + R0;
}
function imascroller() {
// variables declaration
var i, k;
showtime();
// Prosze zwrocic uwage na uzycie funkcji Liczebnik do generowania koncowek
var msg= " "+Liczebnik( daysLeft, "Został"," ","y ","o " ) +
daysLeft+Liczebnik( daysLeft, " ","dzien, ","dni, ","dni, " ) +
hrsLeft +Liczebnik( hrsLeft," godzin", "a","y","" ) +" i "+
minsLeft+Liczebnik( minsLeft," minut", "a ","y "," " )+" do roku 2000!"+
" ";
// increase msg
k=(150/msg.length)+1;
for(i=0;i<=k;i++) msg+=" "+msg;
// show it to the window
document.forms[0].imascroller.value=msg.substring(position,position+300);
// set new position
if (position ++== 300) position = 0;
// repeat at entered speed
id = setTimeout( "imascroller()", 200 );
}
// End Hiding Here -->
</script>
Na poczštku w znaczniku BODY należy jeszcze dodać
<body onload="imascroller()">
W ciele strony należy dodać wywołanie okienka z tekstem
<form ID="form2" action=get>
<input type="text" name="imascroller" size="60" value="">
</form>
<?php
//Count Down of Days:Hours:Minutes:Seconds
//by T.Gard (tom_g@execpc.com) written 01/09/2001
//
//Date/Time counting down too.
$datetime=strtotime( "2001-01-27 11:00" );
//Retrieve the current date/time
$date2=strtotime("NOW");
if ($datetime < $date2) {
print "The Event is here!! or over with!! <br> ".$date2." is greater than ".$datetime."<br>";
} else {
//List total time by type
//Seconds
echo "total seconds remaining: ".(($datetime-$date2)). "<br>";
$holdtotsec=(($datetime-$date2));
//Minutes
echo "total minutes remaining: ".(($datetime-$date2)/60). "<br>";
$holdtotmin=(($datetime-$date2)/60);
//Hours
echo "total hours remaining: ".(($datetime-$date2)/3600). "<br>";
$holdtothr=(($datetime-$date2)/3600);
//
//Days - a day is a 24 hour period
//This gives days remaining
$holdtotday=intval(($datetime-$date2)/86400);
echo "total days remaining: ".$holdtotday. "<br>";
//
//Find hours remaining - get days in hours and sub from tothr
$holdhr=intval($holdtothr-($holdtotday*24));
echo "hours remaining: ".($holdhr). "<br>";
//
//Find minutes remaining - get days and hours in minutes and sub from totmin
$holdmr=intval($holdtotmin-(($holdhr*60)+($holdtotday*1440)));
echo "minutes remaining: ".($holdmr). "<br>";
//
//Find seconds remaining - get days hours minutes in seconds and sub from totsec
$holdsr=intval($holdtotsec-(($holdhr*3600)+($holdmr*60)+(86400*$holdtotday)));
echo "seconds remaining: ".($holdsr). "<br>";
}
?>
</body>
Strona w trakcie tworzenia
Użytkownicy przeglądający ten dział: Brak zidentyfikowanych użytkowników i 109 gości