?Uncaught TypeError: Cannot read property 'scrollTop' of undefined。不知道怎么會(huì)未定義,求解釋?zhuān)。。?/h1>
?self.scrollTo(self.$cont[0].scrollTop + self.getAnchorPosition(index));
?self.scrollTo(self.$cont[0].scrollTop + self.getAnchorPosition(index));
2016-11-21
我也遇到過(guò)你這個(gè)問(wèn)題,后面發(fā)現(xiàn)是self的值已經(jīng)指向window了,在前面再加一句var self = this就好了