Created
September 30, 2015 05:15
-
-
Save s-hiroshi/f557e3e4aa2e53558cd3 to your computer and use it in GitHub Desktop.
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
/** | |
* オフセット設定 | |
* | |
* @method | |
* @private | |
* @param {jQuery} elem オフセットを設定する要素です。 | |
* @param {Object} initial 要素の初期の大きさです。 | |
* @param {Int} initial.width 初期の幅です。 | |
* @param {Int} initial.height 初期の高さです。 | |
* @returns {Function} | |
*/ | |
function setOffset( elem, initial ) { | |
return function () { | |
elem.css( { | |
"left": (initial.width - elem.width()) / 2, | |
"top": (initial.height - elem.height() ) / 2 | |
} ); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment