grazie mille, ma ancora non mi funziona allora ho modificato come mi hai suggerito:
codice:
//nella pag. htm contente il js
<Script>
var pic = new Array()
function banner(name, width, link){
this.name = name
this.width = width
this.link = link
}
pic[0] = new banner('img_scroll/256228_sunflowers.jpg',112,'')
pic[1] = new banner('img_scroll/289593_colors_of_the_countryside.jpg',112,'')
var speed = 50
var kk = pic.length
var ii
var hhh
var nnn
var myInterval
var myPause
var mode = 0
var imgArray = new Array(kk)
var myLeft = new Array(kk)
for (ii=0;ii<kk;ii++){
imgArray[ii] = new Image()
imgArray[ii].src = pic[ii].name
imgArray[ii].width = pic[ii].width
hhh=0
for (nnn=0;nnn<ii;nnn++){
hhh=hhh+pic[nnn].width
}
myLeft[ii] = hhh
}
function ready(){
for (ii=0;ii<kk;ii++){
if (document.images[ii].complete == false){
return false
break
}
}
return true
}
function startScrolling(){
if (ready() == true){
window.clearInterval(myPause)
myInterval = setInterval("autoScroll()",speed)
}
}
function autoScroll(){
for (ii=0;ii<kk;ii++){
myLeft[ii] = myLeft[ii] - 1
if (myLeft[ii] == -(pic[ii].width)){
hhh = 0
for (nnn=0;nnn<kk;nnn++){
if (nnn!=ii){
hhh = hhh + pic[nnn].width
}
}
myLeft[ii] = hhh
}
//come da tuo suggerimento ho inserito il +'px'
document.images[ii].style.left = myLeft[ii]+'px'
}
mode = 1
}
function stop(){
if (mode == 1){
window.clearInterval(myInterval)
}
if (mode == 0){
window.clearInterval(myPause)
}
}
function go(){
if (mode == 1){
myInterval = setInterval("autoScroll()",speed)
}
if (mode == 0){
myPause = setInterval("startScrolling()",3000)
}
}
myPause = setInterval("startScrolling()",3000)
//come da tuo suggerimento ho tolto l'apertura e la chiusura del <body>
for (ii=0;ii<kk;ii++){
document.write('<a href = ' + pic[ii].link + ' target="_blank" >[img] + pic[ii].name + [/img]</a>')
}
</Script>
//nella home.php che include scroll.htm
<div class="textimgArt">
<?php include('webSearch.php');?></p>
</div>
<div class="textimgGal">
<h2>Gallery Artits</h2>
<div>
<?php include('scroller.htm');?>
</div>
</div>
Volevo dirti che, la home.php è a sua volta richiamata nella index.php, forse è questo il problema?
Aspetto tue notizie grazie mille...