Odpočet času
<body onLoad="startclock();">

<SCRIPT LANGUAGE="JavaScript">

var timerID = null;
var timerRunning = false;
function showtime() {
today = new Date();
BigDay = new Date("
december 31, 2008")
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
hrsLeft = hrsLeft;
e_minsLeft = (e_hrsLeft - hrsLeft)*60;
secLeft = Math.floor(e_hrsLeft);
secLeft = Math.floor((e_minsLeft - minsLeft)*60);
secLeft = secLeft;
Temp3='
Do konce roku 2008 zbývá: '+daysLeft+' dní, '+hrsLeft+' hodin, '+minsLeft+' minut, '+secLeft+' sekund.'
document.frm.left.value=Temp3;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
var timerID = null;
var timerRunning = false;
function stopclock () {
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function stopClock() {
        stopclock();  
        return;
}
function startclock () {
stopclock();
showtime();
}
// -->
</script>

<p align="center"><center>

<form name="frm"><input type="textarea" name="left" size="70“ style="background-color: #00ff00; text-align: center; font: 10pt Verdana, Arial; border: 1px solid black"></form>
</center></p>


Přesměrování stránky po 10s

Do hlavičky vlož...<SCRIPT TYPE="text/javascript">
 <!--
    var counter = 10;
    var lokaceWebu = "
http://www.keli.websnadno.cz";
function casovaFunkce()
{
      document.getElementById('vypisPocitadla').innerHTML = --counter+"...";
   
    if (counter==0)
    {
    document.location.href = lokaceWebu;
    clearTimeout(mujTimer);
    }
}
 
    window.onload = function(){
mujTimer = setInterval('casovaFunkce()',1000);
}


 -->
</SCRIPT>
A tento kód mezi <body>...<center><H1><div id='vypisPocitadla'>10...</div></H1></center>

Po zadaném čase přejde automaticky na jinou stránku

<SCRIPT LANGUAGE="JavaScript">
<!--
  setTimeout ("location.href='
http://nějaká stránka.htm?' " , 20000) ;
//-->
</SCRIPT>

Při načtení stránky se otevře nové okno
<SCRIPT language=JavaScript>
<!--
window.open("
http://nějaká stránka.htm?","konzole","scrollbars=0,width=600,height=420")
// -->
</SCRIPT>


Přivítání návštěvníka jeho jménem
<center>
<b><font face="Times New Roman"><FONT COLOR=blue size=3>Přivítá náv�těvníka jeho jménem</FONT></FONT></b>

<SCRIPT LANGUAGE="JavaScript">
var x=prompt("Zadejte svoje jméno, v oslovovacím pádě: např.: Tondo")
document.write("<MARQUEE behavior=alternate width=250 height=53><Font color=navy size=4>Vítej na této stránce, "+x+"</font></marquee>");
</SCRIPT>
</center>


Fáze měsíce
<script language="JavaScript">
<!--
function showMoon() {
var height=1;
var size = 25;
var i;

var currentDate  = new Date();
var x = currentDate;
    currentDate.setTime(currentDate.getTime() + (currentDate.getTimezoneOffset()*60000));
var blueMoonDate = new Date(96, 1, 3, 16, 15, 0);
var lunarPeriod  = 29*(24*3600*1000) + 12*(3600*1000) + 44.05*(60*1000);
var moonPhaseTime = (currentDate.getTime() - blueMoonDate.getTime()) % lunarPeriod;
var percentRaw = (moonPhaseTime / lunarPeriod);
var percent    = Math.round(100*percentRaw) / 100;
var percentBy2 = Math.round(200*percentRaw);
var left  = (percentRaw >= 0.5) ? "mblack.gif" : "mwhite.gif";
var right = (percentRaw >= 0.5) ? "mwhite.gif" : "mblack.gif";

document.write("<center>")

    if (percentBy2 > 100) {
        percentBy2 = percentBy2 - 100
        }

    for (i = -(size-1); i < size; ++i) {
        var wid=2*parseFloat(Math.sqrt((size*size)-(i*i)));
        if (percentBy2 != 100)
            document.write ("<img src="+left +" height=1 width="+(wid*((100-percentBy2)/100))+">")
        if (percentBy2 != 0)
            document.write ("<img src="+right+" height=1 width="+(wid*((percentBy2)/100))+">")
        document.write ("<br>")
    }

document.write(    "</center>",
                "Příští úplněk bude za ",
                Math.round((lunarPeriod-moonPhaseTime)/(24*3600*1000)),
                " dní",
                "")
}
// -->
</script>
<script>
showMoon();
</script>


Hlášky-klikni na nadpis

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>onclick</title>
<SCRIPT TYPE="text/javascript">
function hlaska(){
alert('Kliknul jsi na nadpis.')
alert('Tak už na něj neklikej.')
alert('Ale to už tady jednou bylo.')
}
</SCRIPT>
</head>
<body>
<h1 onclick="hlaska()">Klikni na tenhle nadpis!</h1>
</body>
</html>


Barevné menu
<html>
  <head>

<title></title>

</head>

<body>


<div id="MainFrame" style="LEFT: 5px; POSITION: absolute; TOP: 5px;">
<div id="first" style="LEFT: 0px; POSITION: relative; top: 0px; cursor: default; background-color: #00CCFF; layer-background-color: #00CCFF; border: 1px none #000000; color: #FF0000; font-weight: bold; border-color: #00FF00; border-width: 4px; 2px;2px;2px;border-style: outset; padding: 2px; margin: 2px; text-align: center;" onClick="Go()" onMouseDown="ButtonEff(1,'down')" onMouseUp="ButtonEff(1,'up')" onMouseOver="OverEff(1,'over')" onMouseOut="OverEff(1,'out')">klikni zde</div>
<div id="second" style="LEFT: -300px; POSITION: relative; top: -1px; cursor: default; background-color: #00FF00; layer-background-color: #00FF00; border: 1px none #000000; color: #0000FF; font-weight: bold; border-color: #FFFF00; border-width: 4px; 2px;2px;2px;border-style: outset; padding: 2px; margin: 2px;" onClick="Load(1)" onMouseDown="ButtonEff(2,'down')" onMouseUp="ButtonEff(2,'up')" onMouseOver="OverEff(2,'over')" onMouseOut="OverEff(2,'out')">http://www.sledujonline.nolimit.cz</div>
<div id="third" style="LEFT: -400px; POSITION: relative; top: -2px; cursor: default; background-color: #00FF00; layer-background-color: #00FF00; border: 1px none #000000; color: #0000FF; font-weight: bold; border-color: #FFFF00; border-width: 4px; 2px;2px;2px;border-style: outset; padding: 2px; margin: 2px;" onClick="Load(2)" onMouseDown="ButtonEff(3,'down')" onMouseUp="ButtonEff(3,'up')" onMouseOver="OverEff(3,'over')" onMouseOut="OverEff(3,'out')">http://www.sledujonline.nolimit.cz</div>
<div id="fourth" style="LEFT: -500px; POSITION: relative; top: -3px; cursor: default; background-color: #00FF00; layer-background-color: #00FF00; border: 1px none #000000; color: #0000FF; font-weight: bold; border-color: #FFFF00; border-width: 4px; 2px;2px;2px;border-style: outset; padding: 2px; margin: 2px;" onClick="Load(3)" onMouseDown="ButtonEff(4,'down')" onMouseUp="ButtonEff(4,'up')" onMouseOver="OverEff(4,'over')" onMouseOut="OverEff(4,'out')">http://www.sledujonline.nolimit.cz</div>
</div>
<script>
var i = - 300;
var j = - 400;
var k = - 500;
var SlideIn = false;
function ButtonEff( Nb, state )
{
   if ( state == 'up' )
   {
      if ( Nb == 1 )
      {
         document.getElementById( "first" ).style.borderStyle = "outset"
      }
      if ( Nb == 2 )
      {
         document.getElementById( "second" ).style.borderStyle = "outset"
      }
      if ( Nb == 3 )
      {
         document.getElementById( "third" ).style.borderStyle = "outset"
      }
      if ( Nb == 4 )
      {
         document.getElementById( "fourth" ).style.borderStyle = "outset"
      }
   }
   if ( state == 'down' )
   {
      if ( Nb == 1 )
      {
         document.getElementById( "first" ).style.borderStyle = "inset"
      }
      if ( Nb == 2 )
      {
         document.getElementById( "second" ).style.borderStyle = "inset"
      }
      if ( Nb == 3 )
      {
         document.getElementById( "third" ).style.borderStyle = "inset"
      }
      if ( Nb == 4 )
      {
         document.getElementById( "fourth" ).style.borderStyle = "inset"
      }
   }
}

//  ---------------------------------------

function OverEff( Nb, Ovstate )
{
   if ( Ovstate == 'over' )
   {
      if ( Nb == 1 )
      {
         document.getElementById( "first" ).style.color = "#00CCFF";
         document.getElementById( "first" ).style.backgroundColor = "red";
      }
      if ( Nb == 2 )
      {
         document.getElementById( "second" ).style.color = "#00FF00";
         document.getElementById( "second" ).style.backgroundColor = "#0000FF";
      }
      if ( Nb == 3 )
      {
         document.getElementById( "third" ).style.color = "#00FF00";
         document.getElementById( "third" ).style.backgroundColor = "#0000FF";
      }
      if ( Nb == 4 )
      {
         document.getElementById( "fourth" ).style.color = "#00FF00";
         document.getElementById( "fourth" ).style.backgroundColor = "#0000FF";
      }
   }
   if ( Ovstate == 'out' )
   {
      if ( Nb == 1 )
      {
         document.getElementById( "first" ).style.color = "red";
         document.getElementById( "first" ).style.backgroundColor = "#00CCFF";
      }
      if ( Nb == 2 )
      {
         document.getElementById( "second" ).style.color = "#0000FF";
         document.getElementById( "second" ).style.backgroundColor = "#00FF00";
      }
      if ( Nb == 3 )
      {
         document.getElementById( "third" ).style.color = "#0000FF";
         document.getElementById( "third" ).style.backgroundColor = "#00FF00";
      }
      if ( Nb == 4 )
      {
         document.getElementById( "fourth" ).style.color = "#0000FF";
         document.getElementById( "fourth" ).style.backgroundColor = "#00FF00";
      }
   }
}

//  ---------------------------------------

function DoIt()
{
   if ( i < 0 )
   {
      i += 4;
      document.getElementById( "second" ).style.left = i;
   }
   if ( j < 0 )
   {
      j += 4;
      document.getElementById( "third" ).style.left = j;
   }
   if ( k < 0 )
   {
      k += 4;
      document.getElementById( "fourth" ).style.left = k;
   }
   if ( ( k == 0 ) || ( SlideIn == false ) )
   {
      clearInterval( Over );

   }
}

//  ---------------------------------------

function ReversIt()
{
   if ( ( i > - 300 ) && ( j < - 100 ) && ( k < - 200 ) )
   {
      i -= 4;
      document.getElementById( "second" ).style.left = i;
   }
   if ( ( j > - 400 ) && ( k < - 200 ) )
   {
      j -= 4;
      document.getElementById( "third" ).style.left = j;
   }
   if ( k > - 500 )
   {
      k -= 4;
      document.getElementById( "fourth" ).style.left = k;
   }
   if ( ( k == - 500 ) || ( SlideIn == true ) )
   {
      clearInterval( Out );
   }
}

//  ---------------------------------------

function Go()
{
   SlideIn = ! SlideIn;
   if( SlideIn == true )
   {
      Over = setInterval( "DoIt()", 1 );
   }
   else
   {
      Out = setInterval( "ReversIt()", 1 );
   }
}

//  ---------------------------------------

function Load( Nb )
{
   if ( Nb == 1 )
   {
      window.location = "http://www.sledujonline.nolimit.cz";
   }
   if ( Nb == 2 )
   {
      window.location = "
http://www.sledujonline.nolimit.cz";
   }
   if ( Nb == 3 )
   {
      window.location = "
http://www.sledujonline.nolimit.cz.cz
";
   }
}

</script>

</body>

</html>


Barevné rozbalovací menu
<HTML><head>

 <SEQUENCE order="Text1, Text2, Text3, Text4, Text5, Text6, Text7" speed="20"
type="auto" increments=10>
<SCRIPT LANGUAGE="JavaScript">
var slideShow = new Object();
function initSequence(s) {
var sTemp = s.sequences[s.currentSequence];
if (null != sTemp) {
s.sequencer = new Array();
s.sequencer = sTemp.getAttribute("order").split(", ");
for (var intLoop=0; intLoop < s.sequencer.length;
intLoop++)
if (null != document.all[s.sequencer[intLoop]]) {
var el = document.all[s.sequencer[intLoop]];
el.initTop = el.style.posTop;
el.initLeft = el.style.posLeft;
}
s.speed = (null == sTemp.getAttribute("speed")) ?
20 : sTemp.getAttribute("speed");
s.type = ("auto" == sTemp.getAttribute("type"));
s.increments =
(null == sTemp.getAttribute("increments")) ?
15 : sTemp.getAttribute("increments");
s.inc = 0;
s.position = -1;
}
else {
s.position = null;
if (document.onclick == doFly)
document.onclick = new Function();
}
}

function nextSequence(s) {
if (null != s.position) {
s.position++
if (s.position < s.sequencer.length) {
s.inc = 0;
if (s.type)
window.setTimeout("doFly();", s.speed)
else
document.onclick = doFly;
}
else {
s.currentSequence++;
initSequence(s);
nextSequence(s);
}
}
else {
s.position = null;
if (document.onclick == doFly)
document.onclick = null;
}
}

function slide() {
slideShow.sequences = document.all.tags("SEQUENCE");
slideShow.sequencer = new Array();
if (0 < slideShow.sequences.length) {
slideShow.currentSequence = 0;
initSequence(slideShow);
nextSequence(slideShow);
}
}
function doFly() {
var dt, dl;
var el =
document.all[slideShow.sequencer[slideShow.position]];
document.onclick = null;
slideShow.inc++;
dt = el.initTop / slideShow.increments;
dl = el.initLeft / slideShow.increments;
el.style.posTop = el.style.posTop - dt;
el.style.posLeft = el.style.posLeft - dl;
if (slideShow.inc < slideShow.increments)
window.setTimeout("doFly();", slideShow.speed)
else {
el.style.top = 0;
el.style.left = 0;
nextSequence(slideShow);
}
}
</SCRIPT>
<STYLE TYPE="text/css">
Name
Email
Comment
Or visit this link or this one