Results 1 to 2 of 2

Thread: Top-Down scrolling window

  1. #1
    Join Date
    Feb 2005
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Top-Down scrolling window

    Hello,

    Please let me know what's wrong with this Script, it doesn't work properly!:
    http://www.dynamicdrive.com/dynamicindex8/topscroll.htm

    <script language="JavaScript1.2">

    /*
    Top-Down scrolling window Script- © Dynamic Drive (www.dynamicdrive.com)
    For full source code, visit http://www.dynamicdrive.com
    This notice MUST stay intact for use
    */

    //change 1 to another integer to alter the scroll speed. Greater is faster
    var speed=1
    var currentpos=0,alt=1,curpos1=0,curpos2=-1
    function initialize(){
    startit()
    }

    function iecompattest(){
    return (document.compatMode!="BackCompat")? document.documentElement : document.body
    }

    function scrollwindow(){
    if (document.all)
    temp=iecompattest().scrollTop
    else
    temp=window.pageYOffset
    if (alt==0)
    alt=1
    else
    alt=0
    if (alt==0)
    curpos1=temp
    else
    curpos2=temp
    if (curpos1!=curpos2){
    if (document.all)
    currentpos=iecompattest().scrollTop+speed
    else
    currentpos=window.pageYOffset+speed
    window.scroll(0,currentpos)
    }
    else{
    currentpos=0
    window.scroll(0,currentpos)
    }
    }
    function startit(){
    setInterval("scrollwindow()",10)
    }
    window.onload=initialize
    </script>



    Thanks,
    Jimijoe

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Can you elaborate what the problem is, and in what browser?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •