Results 1 to 6 of 6

Thread: How to pause gAjax RSS Pausing scroller on mouse over?

  1. #1
    Join Date
    Feb 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default How to pause gAjax RSS Pausing scroller on mouse over?

    1) Script Title: gAjax RSS Pausing scroller

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

    3) Describe problem: Does anyone know how to alter the javascript for this scroller so that when the user mouses over it the scrolling will pause?

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

    Default

    The script does that already actually. Or am I misunderstanding your question?
    DD Admin

  3. #3
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    I think they want to be able to stop it while it's running. If it starts moving there's nothing you can do to stop it.

  4. The Following User Says Thank You to Snookerman For This Useful Post:

    crogers32 (02-08-2009)

  5. #4
    Join Date
    Feb 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    That's right Snookerman. I wanted to know if it was possible to stop the scroller from moving up while it was moving by holding the mouse over it.

  6. #5
    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

    There's not much point in stopping it in mid transition, unless you haven't allowed enough room for each item. But I suppose it could be done.

    In the gajaxscroller.js file, use this _animateup() function:

    Code:
    // -------------------------------------------------------------------
    // _animateup()- Move the two inner divs of the scroller up and in sync
    // -------------------------------------------------------------------
    
    gfeedpausescroller.prototype._animateup=function(){
    	var scrollerinstance=this
    	if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
    		setTimeout(function(){scrollerinstance._animateup()}, 100)
    	else{
    		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)
    		}
    	}
    }
    and this _rotatemessage() function:

    Code:
    // -------------------------------------------------------------------
    // _rotatemessage()- Populate the hidden div with the next message before it's visible
    // -------------------------------------------------------------------
    
    gfeedpausescroller.prototype._rotatemessage=function(){
    	var scrollerinstance=this
    	var i=this.hiddendivpointer
    	var ceiling=this.feeds.length
    	this.hiddendivpointer=(i+this.itemsperpage>ceiling-1)? 0 : i+this.itemsperpage
    	var feedslice=this.feeds.slice(this.hiddendivpointer, this.hiddendivpointer+this.itemsperpage)
    	this.hiddendiv.innerHTML=formatrssmessage(feedslice, this.showoptions, this.itemcontainer, this.linktarget)
    	this._animateup()
    }
    Replace the existing functions of the same name with the above ones.
    Last edited by jscheuer1; 02-08-2009 at 04:32 AM. Reason: add actual code
    - John
    ________________________

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

  7. The Following User Says Thank You to jscheuer1 For This Useful Post:

    crogers32 (02-15-2009)

  8. #6
    Join Date
    Feb 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    That worked perfectly! Thanks 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
  •