Results 1 to 3 of 3

Thread: How to control scrolling speed on gAJAX RSS Pausing Scroller

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

    Default How to control scrolling speed on gAJAX RSS Pausing Scroller

    1) Script Title: gAJAX RSS Pausing Scroller

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...sescroller.htm

    3) Describe problem: How can I control the speed of the scroller?

    Thanks.

  2. #2
    Join Date
    Nov 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I had the same question today - found your thread with no answers...

    So I did some digging and figured it out. Registered here just to get you the reply

    In the file gajaxscroller.php around Line 109, _animateup is defined:

    Code:
    // -------------------------------------------------------------------
    // _animateup()- Move the two inner divs of the scroller up and in sync
    // -------------------------------------------------------------------
    
    gfeedpausescroller.prototype._animateup=function(){
    	var scrollerinstance=this
    	if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
    		this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
    		this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
    		setTimeout(function(){scrollerinstance._animateup()}, 40)
    	}
    	else{
    		this.getinline(this.hiddendiv, this.visiblediv)
    		this._swapdivs()
    		setTimeout(function(){scrollerinstance._rotatemessage()}, this.delay)
    	}
    }
    The important numbers:

    40: Number of milliseconds between movement. The lower the number, the 'smoother' the movement. However be warned, this WILL up the client's CPU usage.

    5: Number of pixels to move per movement interval listed above.

    So the default setting is to move the text up 5 pixels every 40 milliseconds.

    For example, changing 40 to 80 will make the scrolling 'slower', but it will look jittery as it's still moving 5 pixels, just at a slower rate.

    Changing 5 to 2 will make the scrolling seem slower as it's only moving 2 pixels every 40ms, but will up the CPU usage.

    Finding a happy medium that you like will be up to you.

    I'm happy with 40 and 2.

  3. #3
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your help cam815! I was looking for this answer, came across this post, and was able to implement it quickly...
    Thanks again!

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
  •