Permalink
Browse files

fix: addClass ie9兼容

  • Loading branch information...
Boyuzhou
Boyuzhou committed Dec 5, 2016
1 parent 5d5eb26 commit b2bb857a0db331e54e7453795b5d1f2a3c90cd5f
Showing with 7 additions and 3 deletions.
  1. +7 −3 js/dom.js
View
@@ -12,13 +12,17 @@ import { on,stopEvent } from './event';
var addClass = function(element, value) {
if(element){
if(typeof element.classList === 'undefined') {
if(u._addClass)
if(u._addClass){
u._addClass(element, value);
}else{
$(element).addClass(value);
}
} else {
element.classList.add(value);
}
}
return this;
};
/**
@@ -192,7 +196,7 @@ var getScroll = function(Node, offset) {
offset.top += Node.scrollTop;
offset.left += Node.scrollLeft;
}
if(Node.parentNode)
return getScroll(Node.parentNode, offset);
else

0 comments on commit b2bb857

Please sign in to comment.