This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Works with elements or jquery | |
* | |
* scrollTo(element, duration, offset); | |
* | |
* Update 'scroller' variable with custom scrolling element if not document.body | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([], function() { | |
//use: module.easeInExpo( time, beginning value, change in value, duration ); | |
return { | |
linear: function (t, b, c, d) { | |
return (t==0) ? b : c*(t/=d) + b; | |
}, | |
easeInQuad: function (t, b, c, d) { | |
return c*(t/=d)*t + b; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.centerIn = function (parent) { | |
var parentHeight = parent.height(), | |
parentWidth = parent.width(), | |
assetHeight = this.height(), | |
assetWidth = this.width(), | |
parentRatio = parentWidth / parentHeight, | |
assetRatio = assetWidth / assetHeight; | |
//----> ratio | |
if ( parentRatio < imgRatio ) { |
NewerOlder