style="display:none" på samtliga:
<div id="rotator">
<img
src="9rules.jpg"
alt="9rules Network"
title="9rules Network"
onclick="parent.location='http://9rules.com/'"
style="display:none"
/>
<img
src="cssbeauty.jpg"
alt="CSS Beauty"
title="CSS Beauty"
onclick="parent.location='http://cssbeauty.com/'"
style="display:none"
/>
<img
src="godbit.jpg"
alt="Godbit Project"
title="Godbit Project"
onclick="parent.location='http://godbit.com/'"
style="display:none"
/>
<img
src="stylegala.jpg"
alt="Stylegala"
title="Stylegala"
onclick="parent.location='http://stylegala.com/'"
style="display:none"
/>
<img
src="yahoo.jpg"
alt="Yahoo!"
title="Yahoo!"
onclick="parent.location='http://yahoo.com/'"
style="display:none"
/>
</div>
xfade2.js:
/*
Image Cross Fade Redux
Version 1.0
Last revision: 02.15.2006
[email]steve@slayeroffice.com[/email]
Rewrite of old code found here: [url]http://slayeroffice.com/code/imageCrossFade/index.html[/url]
*/
function fisherYates ( myArray ) {
var i = myArray.length;
if ( i == 0 ) return false;
while ( --i ) {
var j = Math.floor( Math.random() * ( i + 1 ) );
var tempi = myArray[i];
var tempj = myArray[j];
myArray[i] = tempj;
myArray[j] = tempi;
}
}
window.addEventListener?window.addEventListener('load',so_init,false):window.attachEvent('onload',so_init);
var d=document, imgs = arr = new Array(), zInterval = null, current=0, pause=false;
function so_init()
{
if(!d.getElementById || !d.createElement)return;
css = d.createElement('link');
css.setAttribute('href','slideshow2.css');
css.setAttribute('rel','stylesheet');
css.setAttribute('type','text/css');
d.getElementsByTagName('head')[0].appendChild(css);
imgs = d.getElementById('rotator').getElementsByTagName('img');
for(i=0;i<imgs.length;i++) arr[i] = imgs[i];
fisherYates(arr);
for(i=1;i<imgs.length;i++) arr[i].xOpacity = 0;
arr[0].style.display = 'block';
arr[0].xOpacity = .99;
setTimeout(so_xfade,3000);
}
function so_xfade()
{
cOpacity = arr[current].xOpacity;
nIndex = arr[current+1]?current+1:0;
nOpacity = arr[nIndex].xOpacity;
cOpacity-=.05;
nOpacity+=.05;
arr[nIndex].style.display = 'block';
arr[current].xOpacity = cOpacity;
arr[nIndex].xOpacity = nOpacity;
setOpacity(arr[current]);
setOpacity(arr[nIndex]);
if(cOpacity<=0)
{
arr[current].style.display = 'none';
current = nIndex;
setTimeout(so_xfade,3000);
}
else
{
setTimeout(so_xfade,50);
}
function setOpacity(obj)
{
if(obj.xOpacity>.99)
{
obj.xOpacity = .99;
return;
}
obj.style.opacity = obj.xOpacity;
obj.style.MozOpacity = obj.xOpacity;
obj.style.filter = 'alpha(opacity=' + (obj.xOpacity*100) + ')';
}
}
