Last active
August 29, 2015 14:02
-
-
Save therealtakeshi/e0327ea77fa3c1336680 to your computer and use it in GitHub Desktop.
JS Helper Functions
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
function styleByClass (className, styleObj) { | |
var data = styleObj; | |
var length = document.getElementsByClassName(className).length; | |
for (var key in data) { | |
for (var n = 0; n < length; n++) { | |
document.getElementsByClassName(className)[n].style[key] = data[key]; | |
} | |
} | |
} | |
function checkToReload(obj) { | |
if (typeof obj !== "undefined") location.reload(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment