Created
July 31, 2014 15:56
-
-
Save alexmccabe/5281fdf3262f6474f5af to your computer and use it in GitHub Desktop.
This file contains hidden or 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 () { | |
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