Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. if (typeof HTMLElement.prototype.classlist === "undefined") {
  2. HTMLElement.classList = function ClassList() { return this.className.split(' '); };
  3. HTMLElement.classList.prototype.add = function(name) {
  4. if (classList.indexOf(name) !== -1) {
  5. return;
  6. }
  7. classList[classList.length] = name;
  8. this.className = classList.join(' ');
  9. };
  10. HTMLElement.classList.prototype.remove = function(name) {
  11. var index = classList.indexOf(name);
  12. if (index !== -1) {
  13. this.className = classList.splice(index + 1, 1).join(' ');
  14. }
  15. }
  16. }
  17.  
  18. element.classList.add('fadeIn');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement