Skip to content

Instantly share code, notes, and snippets.

@alexmccabe
Created July 31, 2014 15:56
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 alexmccabe/5281fdf3262f6474f5af to your computer and use it in GitHub Desktop.
Save alexmccabe/5281fdf3262f6474f5af to your computer and use it in GitHub Desktop.
(function () {
var apollo = {};
apollo.hasClass = function (elem, className) {
return elem.classList.contains(className);
};
apollo.addClass = function (elem, className) {
elem.classList.add(className);
};
apollo.removeClass = function (elem, className) {
elem.classList.remove(className);
};
apollo.toggleClass = function (elem, className) {
elem.classList.toggle(className);
};
window.apollo = apollo;
})();
apollo.addClass(document.body, 'test');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment