Codice del file esempio.htm
Codice PHP:
<html>
<head>
<style type="text/css">
#slideCont {
margin: 10px;
border: solid 1px #000;
text-align: center;
}
#slideCont img {
margin: 5px;
}
</style>
<script type="text/javascript" src="banner.js"></script>
</head>
<body>
<div id="slideCont" style="position:relative;z-index:1;width:140px;left:400px;overflow:hidden;">
<div id="slideA" style="position:absolute;z-index:1;top:0px;left:0px;width:140px;overflow:hidden;">
[url="http://www.apache.org/"][img]apache.gif[/img][/url]
[url="http://www.haan.net"][img]banner_haan_net_en.gif[/img][/url]
[url="http://www.linux.org/"][img]linux.gif[/img][/url]
[url="http://www.mysql.com/"][img]mysql.gif[/img][/url]
[url="http://www.php.net/"][img]php.gif[/img][/url]
[url="http://www.ubuntu.com/"][img]ubuntu.gif[/img][/url]
<div id="slideB" style="position:relative;z-index:1;top:0px;left:0px;width:140px;overflow:hidden;">
[url="http://www.apache.org/"][img]apache.gif[/img][/url]
[url="http://www.haan.net"][img]banner_haan_net_en.gif[/img][/url]
[url="http://www.linux.org/"][img]linux.gif[/img][/url]
[url="http://www.mysql.com/"][img]mysql.gif[/img][/url]
[url="http://www.php.net/"][img]php.gif[/img][/url]
[url="http://www.ubuntu.com/"][img]ubuntu.gif[/img][/url]
</div>
</div>
</div>
</body>
</html>
testo del file banner.js
Codice PHP:
function clip() {
// width of the banner container
var contWidth = 150;
// height of the banner container
var contHeight = 300;
var id1 = document.getElementById('slideA');
var id2 = document.getElementById('slideB');
var height = id1.offsetHeight;
id1.style.top = parseInt(id1.style.top)-1 + 'px';
document.getElementById('slideCont').style.height = contHeight + "px";
document.getElementById('slideCont').style.clip = 'rect(auto,'+ contWidth +'px,' + contHeight +'px,auto)';
id2.style.display = '';
if(parseFloat(id1.style.top) == -(height/2)) {
id1.style.top = '0px';
}
setTimeout(clip,50)
}
// Multiple onload function created by: Simon Willison
// [url]http://simon.incutio.com/archive/2004/05/26/addLoadEvent[/url]
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(function() {
clip();
});
Cos'è che sbaglio?
E' il codice preso pari pari dall'esempio, qualcun'altro l'ha provato?
Mi sembra un pò assurdo che offline vada e online no.. 
Risultati:
Cosa ottengo io (spero si possa mettere l'indirizzo)
Come deve essere