scrollTop issue on constant moving div
- by joe
I have a FLASH object that I mouse over which in turn calls the following function to scroll a div. It works but due to the constant high speed scrolling it would throw up NULLS. This in turn caused IE to open a new page through my FLASH ActionScript 2.0
I found that by creating the SC variable and throwing in the condition "if it exists" keeps FLASH from causing IE to open a new page.
However, it still creates an error behind the scenes of "Object Required". Although my application works I do not want load up memory with errors.
Any thoughts?
var SC;
function pP(PT){
SC=document.getElementById('P'+PT).offsetTop;
if(SC){document.getElementById('CBOX').scrollTop=SC;}
}