You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Possible to start and stop scrollable? Created Jul 27, 2009

This thread is solved

Views: 676     Replies: 1     Last reply Jul 27, 2009  
You must login first before you can use this feature

fruitbatinshades

Posts: 3

Registered:
Jun 25, 2009

Possible to start and stop scrollable?

Posted: Jul 27, 2009

I have been trying to get scrollable to start and stop. I can't seem to get it to work. I call scrollapi.interval = 0 which does stop it but I cannot get it to restart!

I've tried

scrollapi.interval,scrollapi.seekto() and scrollapi.reload() but none of them restart the animation! Any idea where I'm going wrong?


var scrollapi;
	$('div.timeline a.next').attr('href', '#').bind('mouseenter', pause).bind('mouseleave', start);
	$('div.timeline a.prev').attr('href', '#').bind('mouseenter', pause).bind('mouseleave', start);
	function pause() {
		scrollapi.getConf().interval = 0;
		scrollapi.reload();
	}
	function start() {
		scrollapi.getConf().interval = 350;
		scrollapi.getConf().easing = 'swing';
		scrollapi.reload();
	}

Liam Gooding
Custom swf skins, custom swf plugins, custom JS plugins, video CMS - http://goodingsmedia.com

Posts: 357

Registered:
Dec 16, 2008

» Possible to start and stop scrollable?

Posted: Jul 27, 2009

Reply to: Possible to start and stop scrollable?, from fruitbatinshades
The autoscrolling is been ported over to a seperate plugin to change how scrollable handles this.

Currently, it will pause on mouse-over and resume on mouse-out as default behavior.

http://flowplayer.org/tools/demos/scrollable/autoscroll.html

From Line 404 onwards over the source-code of JUST scrollable 1.0.5


// interval stuff
		var timer = null;

		function setTimer() {

			// do not start additional timer if already exists
			if (timer) { return; }
			
			// construct new timer
			timer = setInterval(function()  {
					
				// check if interval is being changed dynamically during runtime
				if (conf.interval === 0) {					
					clearInterval(timer);
					timer = 0;
					return;
				}			
				
				self.next();				
			}, conf.interval);
		}	
		
		if (conf.interval > 0) {			
			
			// when mouse enters, autoscroll stops
			root.hover(function() {			
				clearInterval(timer);		
				timer = 0;
				
			}, function() {		
				setTimer();	
			});
			
			setTimer();	
		}