PLAVAJUCE RYBICKY

ID
NAZOV SKRIPTU:
POPIS CINNOSTI:
DLZKA:
TESTOVANE POD:

 

126
p126.html / p126.zip
Po chvili sa pustia rybicky plavat po obrazovke
5215b
NN 4.01

UKAZKA

Zdrojovy tvar:

<HTML>
<
HEAD>
<
TITLE>JavaScript DESTINATION - P126</TITLE>
<
SCRIPT language="JavaScript">
<!--
function showImage(count)
{
return true;
}
// -->
<
/SCRIPT>
<
STYLE type=text/css>
.mainImage
{
border-style : inset;
border-width : 5px
};
.header
{
position : relative;
font-size : 25pt;
color : #009;
}
.HighCap
{
font-size : 35pt;
color : #009
}
.layer
{
position : relative
}
.largeHiddenImageLayer
{
position : absolute;
left : 40px;
top : 10px;
visibility : hide;
clip : rect(0,0)
}
.smallHiddenImageLayer
{
position : absolute;
left : 120px;
top : 220px;
visibility : hide;
clip : rect(0,0)
}
.form
{
font-size : 14pt;
font-family : "sans serif";
}
.layerBorder
{
border-width : 5px
};
<
/STYLE>
<
/HEAD>
<
BODY>
<
center>
  <
SPAN class=layer name="blank">
<
/SPAN>
  <
SPAN class=layer name=fish1>
<
BR>
<
IMG WIDTH=39 HEIGHT=28 SRC="left.gif">
<
/SPAN>
  <
SPAN class=layer name=fish2>
<
BR>
<
IMG WIDTH=39 HEIGHT=28 ALIGN=TOP SRC="button.gif">
<
/SPAN>
<
SPAN class=layer name=fish3>
<
BR>
<
img width=39 height=28 align=bottom src=left.gif>
<
/SPAN>
  <
SPAN class=layer name=fish4>
<
BR>
<
img width=39 height=28 align=top src=button.gif>
<
/SPAN>
  <
DIV class=largeHiddenImageLayer>
<
form>
<
table bgcolor=white border=5>
<
tr>
<
td colspan=2><img height=480 width=640 src=button.gif></td>
<
/tr>
<
tr border=0 bgcolor=#7F7F7F>
<
td>
<
div align=left>
<
input type=button onclick="return refresh(1)" value=refresh>
<
/div>
<
/td>
<
td>
<
div align=right>
<
input type=button onclick="return hideImage(1)" value=close>
<
/div>
<
/td>
<
/tr>
<
/table>
<
/form>
<
/DIV>
  <
DIV class=smallHiddenImageLayer>
<
form>
<
table bgcolor=white border=5>
<
tr>
<
td><img height=240 width=320 src=button.gif></td>
<
/tr>
<
tr>
<
td bgcolor=#7F7F7F>
<
center>
<
input type=button onclick="return hideImage(2)" value=close>
<
/td>
<
/tr>
<
/table>
<
/form>
<
/DIV>
  <
SCRIPT type=text/javascript>
<!--
var agent=navigator.appVersion;
var layers_capable=false;
if(agent.substring(0,1)>=4) layers_capable=true;
  function setClip(layer,width,height)
{
layer.clip.width=width;
layer.clip.height=height;
}
  function moveClip(layer_num, width, height)
{
xfactor=12;
yfactor=10;
var layer=document.layers[layer_num];
layer.resizeBy(xfactor,yfactor);
if (layer.clip.width<width || layer.clip.height<height) setTimeout("moveClip("+layer_num+","+width+","+height+")",10);
else setClip(document.layers[layer_num], width, height);
}
  first_img_layer=5;
  function hideImage(layer_num)
{
layer_num=layer_num+first_img_layer-1;
document.layers[layer_num].visibility="hide";
return false;
}
  function refresh(count)
{
count=count+first_img_layer-1;
var layer=document.layers[count];
layer.document.images[0].src=layer.document.images[0].src;
}
  function showImage(count, url_name)
{
if(!layers_capable) return true;
count=count+first_img_layer-1;
document.layers[count].document.images[0].src=url_name;
document.layers[count].visibility="show";
if(document.layers[count].clip.height) return false;
if(count > first_img_layer)
{
setClip(document.layers[count-1],0,0);
moveClip(count,340,340);
}
else
{
setClip(document.layers[count+1],0,0);
moveClip(count,700,560);
}
return false;
}
  function bounce(index)
{
var doc=document;
var layer=doc.layers[index];
  if(!layer.velocity)
{
layer.velocity=new Object();
layer.velocity.x=7;
layer.velocity.y=8;
}
  layer.offset(layer.velocity.x,layer.velocity.y);
if (layer.left<-100 || layer.left>500)
{
if(layer.velocity.x>0) layer.document.images[0].src="left.gif";
else layer.document.images[0].src="button.gif";
layer.velocity.x=-layer.velocity.x;
}
if (layer.top<-500 || layer.top>500) layer.velocity.y=-layer.velocity.y;
layer.timeoutid=setTimeout("bounce("+index+")",100);
return false;
}
  function squish(layer_count)
{
// document.layers[layer_count].src = "javascript:document.write('hi there')";
}
  if(layers_capable)
{
var layer_count=0;
var doc=document;
  document.layers[0].moveAbove(document.layers[first_img_layer-1]);
setTimeout("squish("+(first_img_layer-1)+")",8000);
  for(layer_count=0;layer_count<first_img_layer-1;layer_count++)
{
var layer=doc.layers[layer_count];
layer.velocity=new Object();
if (layer_count%4==0)
{
layer.velocity.x=-7;
layer.velocity.y=-8;
}
else if (layer_count%4==1)
{
layer.velocity.x=12;
layer.velocity.y=-7;
}
else if (layer_count%4==2)
{
layer.velocity.x=-9;
layer.velocity.y=10;
}
else if (layer_count%4==3)
{
layer.velocity.x=10;
layer.velocity.y=7;
}
setTimeout("bounce("+layer_count+")",(3000*(layer_count+1))+2000);
}
}
// -->
<
/script>
<
/BODY>
<
/HTML>
[ Navrat ]