Created
February 27, 2018 22:02
-
-
Save AndrewHaine/d7df93aebaa9aafe2656548f8c4b8edd to your computer and use it in GitHub Desktop.
Common helper functions for front end javascript projects
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
/** | |
* A collection of good helper/utility functions | |
* that may be required in a project | |
* | |
* Andrew Haine - 2018 | |
*/ | |
/** | |
* Using CSS transforms in JavaScript? You'll need to stick some vendor prefixes in there | |
* @param {Object} el The element to transform | |
* @param {String} transformation Valid CSS transformation | |
*/ | |
exports.friendlyTransform = function (el, transformation) { | |
el.style.msTransform = transformation; | |
el.style.webkitTransform = transformation; | |
el.style.MozTransform = transformation; | |
el.style.OTransform = transformation; | |
el.style.transform = transformation; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment