DoporučujemeZaložit web nebo e-shop
 

HTML kódy‚ výměna ikonek a bannerů

Whispere.ic.cz

Bude jich víc, budu je sem vkládat postupně..jinak více java scriptů najdete třeba zde

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>



Barevný text

Download

Tlačítko nahoru



<a href="Zde dejte URL stránky na ktere chcete aby bylo tlačítko nahoru."><input type="button" value="Nahoru" /></a>


Tisk stránky

<input type="button" value="Vytisknout" onClick="window.print();">


Tlačítko ZPĚT

Zpět

<P align=center><a href="javascript:history.back(1)">Zpět</a></P>


Běžící text v rámečku


Bezici_text_v_ramecku.rtf (1 KB)


Odkaz, který po najetí myši ujede
Ukázka
Download-Ujizdejici_odkaz.zip (0 KB)


Datum a svátek
Ukázka
Download-Datum_a_svatek.zip (3 KB)

Upoutávka
Ukázka
Download-Upoutavka.zip (1 KB)

Text za myší- funguje v IE
Ukázka
Download-Text_za_myší.zip (1 KB)

Stínování textu-funguje v IE
Ukázka
Download-neonovy_text.zip (1 KB)

Text ve stavovém řádku
Ukázka
Download-Text_ve_stavovem_radku.zip (1 KB)

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
Ukázka
<!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.keli.websnadno.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.keli.websnadno.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.keli.websnadno.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.keli.websnadno.cz";
   }
   if ( Nb == 2 )
   {
      window.location = "
http://www.keli.websnadno.cz";
   }
   if ( Nb == 3 )
   {
      window.location = "
http://www.keli.websnadno.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">
BODY {color:white; BACKGROUND: black url('img001.gif'); }
DIV {position:relative; width:100%; font-size:13pt;
height:40px}
H1 {text-align:center; font-size:18pt}
</STYLE>
</head>

<BODY ONLOAD="slide();">


<p align="center"><font size="4" color="#00FF00">
<DIV ID="Text1" STYLE="top:0px; left:-350px; color:red">
<p align="center"><a href="http://www.keli.websnadno.cz"><font color="#FF0000">
www.keli.websnadno.cz</font></a></DIV>

<DIV ID="Text2" STYLE="top:0px; left:-350px; color:blue">
<p align="center"><a href="http://www.navrcholu.cz/">www.navrcholu.cz</a></DIV>
<DIV ID="Text3" STYLE="top:0px; left:-350px; color:yellow">
<p align="center"><a href="http://www.atlas.cz/"><font color="#FFFF00">www.atlas.cz</font></a></DIV>
<DIV ID="Text4" STYLE="top:0px; left:-350px; color:red">
<p align="center"><a href="www.keli.websnadno.cz"><font color="#FF0000">
www.keli.websnadno.cz</font></a></DIV>
<DIV ID="Text5" STYLE="top:0px; left:-350px; color:blue">
<p align="center"><a href="http://www.centrum.cz/">www.centrum.cz</a></DIV>
<DIV ID="Text6" STYLE="top:0px; left:-350px; color:yellow">
<p align="center"><a href="http://www.www.keli.websnadno.cz/"><font color="#FFFF00">
www.keli.websnadno.cz</font></a></DIV>

</font><font size="4" color="#0000FF">
<DIV ID="Text7" STYLE="top:0px; left:-350px">
<p align="center"><a href="http://www.keli.websnadno.cz">www.keli.websnadno.cz</a></DIV>
</font>
</BODY>
</HTML>


Barevné menu
Ukázka

Krok 1 Script vlož mezi
<head> a </head>.
<style type="text/css">
<!--

.coolmenu{
width: 200px;
}

.coolmenu td{
background-color:bisque;
cursor:hand;
font-family:Arial;
font-weight:bold;
}

.coolmenu td a{
text-decoration:none;
color:black;
}

.coolmenu td#boxdescription{
background: ivory;
height: 25px;
font-weight: normal;
}

-->
</style>

<script language="javascript">
<!--

/*
Cool Table Menu
By Clarence Eldefors (http://www.freebox.com/cereweb) with modifications from javascriptkit.com
Visit http://javascriptkit.com for this and over 400+ other scripts
*/



function movein(which,html){
which.style.background='coral'
if (document.getElementById)
document.getElementById("boxdescription").innerHTML=html
else
boxdescription.innerHTML=html
}

function moveout(which){
which.style.background='bisque'
if (document.getElementById)
document.getElementById("boxdescription").innerHTML='&nbsp;'
else
boxdescription.innerHTML='&nbsp;'
}

//-->
</script>

Krok 2 Script si dej, tam kde chceš menu mít
<table class="coolmenu" bgcolor="black" border="1" bordercolor="ivory" cellpadding="2" cellspacing="0">

<tr>
<td bordercolor="black" id="choice1" onmouseover="movein(this,'Free DHTML Scripts')" onmouseout="moveout(this)"">
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></td></tr>

<td bordercolor="black" id="choice2" onmouseover="movein(this,'Free Java applets')" onmouseout="moveout(this)">
<a href="http://freewarejava.com">Freewarejava.com</a></td></tr>

<td bordercolor="black" id="choice3" onmouseover="movein(this,'CSS Gallery/ Inspiration')" onmouseout="moveout(this)"><a href="http://www.cssdrive.com">CSS Drive</a></td></tr>

<td bordercolor="black" id="choice4" onmouseover="movein(this,'Get Coding Help')" onmouseout="moveout(this)"><a href="http://www.codingforums.com.com">Coding Forums</a></td></tr>

<tr>
<td bordercolor="black" id="boxdescription"></td></tr>
</table>

<p>This free script provided by<br />
<a href="http://javascriptkit.com">JavaScript
Kit</a></p>

Změna barvy pozadí při najetí myší na text

<p align="center">
<font face="Verdana, Arial" size="2"><a href="#" onMouseOver="document.bgColor='yellow';" onMouseOut="document.bgColor='white';">Pro změnu barvy pozadí najeď nad tento text</a></font>

Pro změnu barvy pozadí najeď nad tento text

</p>


Problikávání obrazovky barvami
<script>
<!--- hide script from other browsers
function initArray() {
  this.length = initArray.arguments.length
  for (var i = 0; i < this.length; i++)
    this[i+1] = initArray.arguments[i]
}
var hexChars = "0123456789ABCDEF";
function Dec2Hex (Dec) {
  var a = Dec % 16;
  var b = (Dec - a)/16;
  hex = "" + hexChars.charAt(b) + hexChars.charAt(a);
  return hex;
}
function bgChanger (begin, end, steps) {
  steps = steps -1 ;
  redA    = begin.charAt(0) + begin.charAt(1);
  red_valA = parseInt(redA,'16');
  redB    = end.charAt(0) + end.charAt(1);
  red_valB = parseInt(redB,'16');
  red_int  = ((red_valB - red_valA) / steps) * -1;
  grnA    = begin.charAt(2) + begin.charAt(3);
  grn_valA = parseInt(grnA,'16');
  grnB    = end.charAt(2) + end.charAt(3);
  grn_valB = parseInt(grnB,'16');
  grn_int  = ((grn_valB - grn_valA) / steps) * -1;
  bluA    = begin.charAt(4) + begin.charAt(5);
  blu_valA = parseInt(bluA,'16');
  bluB    = end.charAt(4) + end.charAt(5);
  blu_valB = parseInt(bluB,'16');
  blu_int  = ((blu_valB - blu_valA) / steps) * -1;
  step = 2;
  red = red_valA;
  grn = grn_valA;
  blu = blu_valA;
  document.bgColor = begin;
  while ( steps >= step ) {
    red -= red_int;
    red_round = Math.round(red);
    red_hex = Dec2Hex(red);
    grn -= grn_int;
    grn_round = Math.round(grn);
    grn_hex = Dec2Hex(grn);
    blu -= blu_int;
    blu_round = Math.round(blu);
    blu_hex = Dec2Hex(blu);
    document.bgColor = red_hex + grn_hex + blu_hex;
    step++;
  }
  document.bgColor = end;
}
// end hiding from old browsers -->
<!--- hide script from old browsers
<!--
  bgChanger("000000","000000",25);
  bgChanger("000000","FF0000",25);
  bgChanger("FF0000","000000",25);
  bgChanger("000000","AA00EE",25);
  bgChanger("AA00EE","000000",25);
  bgChanger("000000","0000FF",25);
  bgChanger("0000FF","000000",25);
  bgChanger("AA00EE","FFFFFF",25);
// -->
// end hiding from old browsers -->
</script>

Formulář
Ukázka
Download - formular.rar (1 KB)