Salve a tutti,
Sto cercando di impostare uno scrolling di news in questa pagina
http://www.limatolavvocati.it/scrolling/news.asp
Aprendola con Firefox e Mozilla (da mac ma non so da pc) funziona perfettamente
Ma su Internet Explorer per PC mi da il seguente messaggio
'dataobj.style' è nullo o non è un oggetto
Lo script che ho utilizzato è questo
codice:
var scrollspeed = "1" // SET SCROLLER SPEED 1 = SLOWEST
var speedjump = "20" // ADJUST SCROLL JUMPING = RANGE 20 TO 40
var startdelay = "2" // START SCROLLING DELAY IN SECONDS
var nextdelay = "0" // SECOND SCROLL DELAY IN SECONDS 0 = QUICKEST
var topspace = "0px" // TOP SPACING FIRST TIME SCROLLING
var frameheight = "260px" // IF YOU RESIZE THE WINDOW EDIT THIS HEIGHT TO MATCHZ
current = (scrollspeed)
function HeightData(){
AreaHeight=dataobj.offsetHeight
if (AreaHeight==0){
setTimeout("HeightData()",( startdelay * 1000 ))
}
else {
ScrollNewsDiv()
}}
function NewsScrollStart(){
dataobj=document.all? document.all.NewsDiv : document.getElementById("NewsDiv")
dataobj.style.top=topspace
setTimeout("HeightData()",( startdelay * 1000 ))
}
function ScrollNewsDiv(){
dataobj.style.top=parseInt(dataobj.style.top)-(scrollspeed)
if (parseInt(dataobj.style.top)<AreaHeight*(-90)) {
dataobj.style.top=frameheight
setTimeout("ScrollNewsDiv()",( nextdelay * 1000 ))
}
else {
setTimeout("ScrollNewsDiv()",speedjump)
}}
Ho trovato una discussione in cui si suggeriva di aggiungere questo codice
codice:
function ean( ean ){
var reg = /odataobj.style/;
if ( typeof( reg ) != 'undefined' ){
return reg.test( ean );
}
else {
return true;
}
}
Ma in realtà non so se l'ho personalizzato bene e se la sintassi è giusta
Qualcuno mi sa aiutare?