my friend needs some help with some javascript but i dont do javascript so i fort some 1 on here could help He is useing this for the onload bit of the script. <?php if ( $video == "" ) {} else { echo "<body onload=\"javascript:ScrollWin()\">";}?> PHP: this is the javascript. the thing is that it works with firefox but no i.e. is there a fix so it will work in I.E. <!-- scrollSteps = 100 timer="" moz=document.getElementById&&!document.all function scrollDiv(id){ clearTimeout(timer) scrollingDiv=document.getElementById("playlist") if((moz||window.opera)&&!scrollingDiv.style.position){ browserOffset=scrollingDiv.offsetTop } else{ browserOffset=0 } if(scrollingDiv.scrollTop <= document.getElementById(id).offsetTop-scrollSteps-browserOffset){ scrollingDiv.scrollTop=document.getElementById("playlist").scrollTop+scrollSteps timer=setTimeout("scrollDiv('"+id+"')",10) // if bottom of page reached before anchor point if(scrollingDiv.scrollTop>(scrollingDiv.scrollHeight-scrollingDiv.offsetHeight)-scrollSteps){ clearTimeout(timer) scrollingDiv.scrollTop=document.getElementById("playlist").scrollHeight-scrollingDiv.offsetHeight } } else{ if(scrollingDiv.scrollTop >= document.getElementById(id).offsetTop+scrollSteps-browserOffset){ scrollingDiv.scrollTop=document.getElementById("playlist").scrollTop-scrollSteps timer=setTimeout("scrollDiv('"+id+"')",10) } else{ clearTimeout(timer) scrollingDiv.scrollTop=document.getElementById(id).offsetTop-browserOffset } } } function toTop(){ scrollingDiv=document.getElementById("playlist") clearTimeout(timer) if(scrollingDiv.scrollTop >= scrollSteps){ scrollingDiv.scrollTop=document.getElementById("playlist").scrollTop-scrollSteps timer=setTimeout("toTop()",10) } else{ clearTimeout(timer) scrollingDiv.scrollTop=0 } } // --> PHP:
echo "<body onload=\"javascript crollWin()\">" Code (markup): There is no function called "crollWin". It probably should be scrollWin.. but that doesn't exist either. Plus it's not the correct method to call a function ONxx. It should be just onxxx="MyFunction()". (Without the "javascript")