another pair of eyes...

G

Guest

hey all,

can someone please help me debug the following code to auto scroll a window
for my asp.net page? i don't think i have the page load syntax or few
possible other bugs. The funny thing is the vb version of this is almost
identical and works i missing something.

<script type="text/javascript">

var elBody;
var varChange;
var varAllowDirectionChange ;
var varMilliSecondScroll;


function Page_OnLoad()
{
elBody = window.document.body
varChange=1;
varAllowDirectionChange = true;
varMilliSecondScroll = 25;
window.document.body.scrolltop = 2;
doScroll();
}

function doScroll() {
if(! left(navigator.appVersion,1) => 4){ Exit Function }
sHeight = elBody.scrollheight;
cHeight = elBody.clientheight;
varTarget = elBody.scrolltop + varChange;
if(varTarget < 0){ varTarget = 0 }
elBody.scrolltop = varTarget;
x = SetTimeOut("doScroll()",varMilliSecondScroll,"VBScript");
if(! varAllowDirectionChange){ Exit Function }
if(sHeight-cHeight => varTarget-varChange){ varAbove = True }else{
varAbove = False }
if(sHeight-cHeight <= varTarget+varChange){ varBelow = True }else{
varBelow = False }
if(varAbove && varBelow){ varChange = varChange * -1 }
if(varTarget => 0){ varAbove = True }else{ varAbove = False }
if(varTarget <= 0+abs(varChange)){ varBelow = True }else{ varBelow = False }
if(varAbove && varBelow){ varChange = varChange * -1}
}
</script>


thanks,
rodchar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top