Java Script

Skryptomania

Magiczne przyciski



Kod skryptu:

<HEAD>

<SCRIPT language="javascript">
function preload() {
 this.length = preload.arguments.length;
 for (var i = 0; i < this.length; i++) {
  this[i+1] = new Image();
  this[i+1].src = preload.arguments[i];
 }
}
if (document.images) {
 var stuff = new preload(
 "1on.jpg",
 "2on.jpg")
}
function select(i) {
 if (document.images) {
  var src = document.images[i].src;
  var off = src.lastIndexOf("off");
  if (off != -1) {
   var newsrc = src.substring(0,off) + "on";
   document.images[i].src = newsrc + ".jpg";
  }
 }
}
function deselect(i) {
 if (document.images) {
  var src = document.images[i].src;
  var on = src.lastIndexOf("on");
  if (on != -1) {
   var newsrc = src.substring(0,on) + "off" + src.substring(on + 2, src.length);
   document.images[i].src = newsrc;
  }
 }
}
</SCRIPT></HEAD>

<BODY><A HREF="http://" TARGET="" onMouseOver="select(0)" onMouseOut="deselect(0)"><IMG SRC="1off.jpg" BORDER=0 ></A>
<BR><A HREF="http://" TARGET="" onMouseOver="select(1)" onMouseOut="deselect(1)"><IMG SRC="2off.jpg" BORDER=0 ></A>

</BODY>

A to s╣ obrazki jakie u┐y│em w tym skrypcie:

1off.jpg (11795 bytes)1on.jpg (11397 bytes)2off.jpg (12346 bytes)2on.jpg (10831 bytes)

Masz jakie£ pytania to:

Poprzedni skrypt

NastΩpny skrypt

cruger@friko2.onet.pl

Zegar i alert

Inteligentna strona