scrollTop issue on constant moving div

Posted by joe on Stack Overflow See other posts from Stack Overflow or by joe
Published on 2010-06-05T22:08:01Z Indexed on 2010/06/05 22:12 UTC
Read the original article Hit count: 132

Filed under:

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;}
 }

© Stack Overflow or respective owner

Related posts about JavaScript