examples/template_stealjs/funcunit/browser/actions.js
function( direction, amount, success ) {
			this._addExists();
			var selector = this.selector, 
				context = this.context,
				direction;
			if (direction == "left" || direction == "right") {
				direction = "Left";
			} else if (direction == "top" || direction == "bottom") {
				direction = "Top";
			}
			FuncUnit.add({
				method: function(success, error){
					steal.dev.log("setting " + selector + " scroll" + direction + " " + amount + " pixels")
					this.bind.each(function(i, el){
						this["scroll" + direction] = amount;
					})
					success();
				},
				success: success,
				error: "Could not scroll " + this.selector,
				bind: this,
				type: "action"
			});
			return this;
		}
function( direction, amount, success ) {
			this._addExists();
			var selector = this.selector, 
				context = this.context,
				direction;
			if (direction == "left" || direction == "right") {
				direction = "Left";
			} else if (direction == "top" || direction == "bottom") {
				direction = "Top";
			}
			FuncUnit.add({
				method: function(success, error){
					steal.dev.log("setting " + selector + " scroll" + direction + " " + amount + " pixels")
					this.bind.each(function(i, el){
						this["scroll" + direction] = amount;
					})
					success();
				},
				success: success,
				error: "Could not scroll " + this.selector,
				bind: this,
				type: "action"
			});
			return this;
		}
function ( direction , amount , success ) { this . _addExists ( ) ; var selector = this . selector , context = this . context , direction ; if ( direction == "left" || direction == "right" ) { direction = "Left" ; } else if ( direction == "top" || direction == "bottom" ) { direction = "Top" ; } FuncUnit . add ( { method : function ( success , error ) { steal . dev . log ( "setting " + selector + " scroll" + direction + " " + amount + " pixels" ) this . bind . each ( function ( i , el ) { this [ "scroll" + direction ] = amount ; } ) success ( ) ; } , success : success , error : "Could not scroll " + this . selector , bind : this , type : "action" } ) ; return this ; }
Scrolls an element in a particular direction by setting the scrollTop or srollLeft.
@param {String} direction "left" or "top"
@param {Number} amount number of pixels to scroll
@param {Function} success
Scrolls an element in a particular direction by setting the scrollTop or srollLeft .