another pair of eyes...

Discussion in 'ASP .Net' started by =?Utf-8?B?cm9kY2hhcg==?=, Jul 12, 2006.

  1. 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
     
    =?Utf-8?B?cm9kY2hhcg==?=, Jul 12, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. darrel
    Replies:
    0
    Views:
    348
    darrel
    Jun 21, 2004
  2. Phil Winstanley [Microsoft MVP ASP.NET]

    Re: need second pair of eyes: databinder.eval problem

    Phil Winstanley [Microsoft MVP ASP.NET], Jun 21, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    436
    darrel
    Jun 21, 2004
  3. DaLoverhino

    J2ee: need another pair of eyes.

    DaLoverhino, Nov 22, 2005, in forum: Java
    Replies:
    1
    Views:
    391
    HalcyonWild
    Nov 22, 2005
  4. Replies:
    6
    Views:
    303
    Daniel T.
    Nov 27, 2006
  5. Laiverd.COM
    Replies:
    9
    Views:
    106
    Richard Cornford
    Aug 5, 2004
Loading...

Share This Page