Skip to content

Instantly share code, notes, and snippets.

@therealtakeshi
Last active August 29, 2015 14:02
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 therealtakeshi/e0327ea77fa3c1336680 to your computer and use it in GitHub Desktop.
Save therealtakeshi/e0327ea77fa3c1336680 to your computer and use it in GitHub Desktop.
JS Helper Functions
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