Results 1 to 3 of 3

Thread: Top-Down scrolling window - pause on mouseover?

  1. #1
    Join Date
    Nov 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Top-Down scrolling window - pause on mouseover?

    Script: Top-Down scrolling window
    http://www.dynamicdrive.com/dynamicindex8/topscroll.htm

    Is there any way to make the scrolling page pause on mouseover (and resume on mouseout) when using the above script?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    <script type="text/javascript">
    
    /*
    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, theInterval, going=0;
    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(){
    if(!going){
    theInterval=setInterval("scrollwindow()",10)
    going=1
    }
    }
    function stopit(){
    clearInterval(theInterval)
    going=0
    }
    window.onload=initialize
    document.onmouseover=stopit;
    document.onmouseout=startit;
    
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah, excellent, thanks a lot John!

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
  •