?Uncaught TypeError: Cannot read property 'scrollTop' of undefined。不知道怎么會未定義,求解釋?。?!
?self.scrollTo(self.$cont[0].scrollTop + self.getAnchorPosition(index));
?self.scrollTo(self.$cont[0].scrollTop + self.getAnchorPosition(index));
2016-07-29
var self = this;這個有加嗎?
_initTabEvent : function() {var self = this;........}
每個函數里都要加var self = this;
不然就找不到對象
舉報
2016-11-21
我也遇到過你這個問題,后面發現是self的值已經指向window了,在前面再加一句var self = this就好了