Hej!
Jag ska ha en bannerväxlare och såg bland jojoxx alltid lika snygga scripts att det fanns just ett sådant. Men problemet är att jag vill länka bilderna, och dessa länkar vill inte riktigt hänga med.
Banner1:s länk visas
Banner2 visas och länken byts
Banner1 visas igen men länken är fortfarande banner2:s.
<div style="height:60px;width:468px;">
<div id="fadea" style="position:absolute;visibility:hidden;"><a href="http://www.joakimweb.se" target="_blank"><img src="/assets/images/jw.gif" width="468" height="60" border="0"/></a></div>
<div id="fadeb" style="position:absolute;visibility:hidden;"><a href="http://www.webcows.se" target="_blank"><img src="/assets/images/webcows.gif" width="468" height="60" border="0"/></a></div>
</div>
<script type="text/javascript">
/* The code contained in this file is copyrighted by [url]www.jojoxx.net[/url]
The file may be used for none commercial applications and distributed
as long as these lines remain intact. The file or part of it may not
be sold or included in any other commercial application without
agreement from the author. If you have questions or comments, contact
the author at [url]http://www.jojoxx.net[/url]
© Copyright - [url]www.jojoxx.net[/url] - 2004 */
var divs=["fadea","fadeb"];
function fade(n,diff,opacity){
id=divs[n];
opacity=(opacity)?opacity:(diff<0)?100:0; opacity+=diff;
if(document.getElementById&&document.all){
document.getElementById(id).style.filter="alpha(opacity="+opacity+")";
}else if(document.getElementById&&!document.all){
document.getElementById(id).style.MozOpacity = opacity/100;
}
document.getElementById(id).style.visibility="visible";
if(opacity>=100){
setTimeout("fade("+n+",-"+diff+","+opacity+");",5000);
nn=(n==divs.length-1)?0:n+1;
setTimeout("fade("+nn+","+diff+");",5000);
} else if(opacity>0){
setTimeout("fade("+n+","+diff+","+opacity+");",30);
}
}
fade(0,1);
</script>
Hoppas någon har tid och lust att hjälpa mig.
Tack på förhand
/Joakim