The ways of the Nerds
works in newer browsers
<body>
<img src="MenuBoxesSoFwebsitetableonl.jpg" src2="MenuBoxesSoFwebsitetable-11.jpg" width="30" height="28" alt="" border="0">
</body>
<script>
for(i=0;i<document.images.length;i++){
if(document.images[i].getAttribute('src2'))
{
document.images[i].onmouseover=new Function("swapIMG(this);");
document.images[i].onmouseout=new Function("swapIMG(this);");
}
}
function swapIMG(aObj){
src=aObj.src;
aObj.src=aObj.getAttribute('src2');
aObj.setAttribute('src2',src);
}
</script>
samme script bare med preloading
<!DOCTYPE html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<body>
<img src="D:\\SKRIVEBORD\\Library\\TEST\\cards\\10.jpg" src2="D:\\SKRIVEBORD\\Library\\TEST\\cards\\2.jpg" width="150" height="112" alt="" border="0">
<img src="D:\\SKRIVEBORD\\Library\\TEST\\cards\\3.jpg" src2="D:\\SKRIVEBORD\\Library\\TEST\\cards\\4.jpg" width="150" height="112" alt="" border="0">
<img src="D:\\SKRIVEBORD\\Library\\TEST\\cards\\5.jpg" src2="D:\\SKRIVEBORD\\Library\\TEST\\cards\\6.jpg" width="150" height="112" alt="" border="0">
<img src="D:\\SKRIVEBORD\\Library\\TEST\\cards\\7.jpg" src2="D:\\SKRIVEBORD\\Library\\TEST\\cards\\8.jpg" width="150" height="112" alt="" border="0">
<img src="MenuBoxesSoFwebsitetableonl.jpg" src2="MenuBoxesSoFwebsitetable-11.jpg" width="30" height="28" alt="" border="0">
<img src="MenuBoxesSoFwebsitetableonl.jpg" src2="MenuBoxesSoFwebsitetable-11.jpg" width="30" height="28" alt="" border="0">
<img src="MenuBoxesSoFwebsitetableonl.jpg" src2="MenuBoxesSoFwebsitetable-11.jpg" width="30" height="28" alt="" border="0">
</body>
<script language="JavaScript1.2">
var Ims=new Array();
for(var i=0;i<document.images.length;i++){
if(document.images[i].getAttribute('src2'))
{
Ims[i*2]=new Image();
Ims[(i*2)].src=document.images[i].getAttribute('src2');
Ims[i*2+1]=new Image();
Ims[i*2+1].src=document.images[i].getAttribute('src');
document.images[i].setAttribute('src2',i*2);
document.images[i].onmouseover=new Function("swapIMG(this);");
document.images[i].onmouseout=new Function("swapIMG(this);");
}
}
function swapIMG(aObj){
var I=aObj.getAttribute('src2');
aObj.src=Ims[I].src;
aObj.setAttribute('src2',I+1-2*(I%2));
}
</script>
notits hvis du går meget op i wc3 folkene skal du nok ikke bruge disse.
-----------------------------------------------------------------------------
Min side ->www.the-hive.dk/~donp/
[Redigeret d. 17/11-04 18:45:37 af Nørden][Redigeret d. 17/11-04 19:20:02 af Nørden]