Skip to content

Instantly share code, notes, and snippets.

@JiLiZART
Created August 23, 2017 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JiLiZART/c04905aded5cc9a79b8c2a36befa2045 to your computer and use it in GitHub Desktop.
Save JiLiZART/c04905aded5cc9a79b8c2a36befa2045 to your computer and use it in GitHub Desktop.
/**
* Shortcut transform function for all supported browsers
* @param {String} transform
* @returns {jQuery}
*/
jQuery.fn.transform = function(transform) {
return this.css({
'-webkit-transform': transform, /* Chrome, Safari 3.1+ */
'-moz-transform': transform, /* Firefox 3.5-15 */
'-ms-transform': transform, /* IE 9 */
'-o-transform': transform, /* Opera 10.50-12.00 */
'transform': transform /* Firefox 16+, IE 10+, Opera 12.10+ */
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment