我在使用Waypoint时遇到了一堆错误。尽管disableAll()正常工作,但除了enableAll()之外,一切都表现得应该如此。主要错误是:
jQuery.Deferred exception: Cannot read property 'top' of undefined TypeError: Cannot read property 'top' of undefined
Uncaught TypeError: Cannot read property 'top' of undefined
我正在从数组中构建我的Waypoints,这是我认为导致问题的原因。该数组包含ID,然后我添加一个字符串以创建相应的Waypoint:
var links = ['#id1', '#id2', '#id3', '#id4'];
$(document).ready(function () {
$.each(links, function (p, linkP) {
var inview = new Waypoint.Inview({
element: $(linkP + 'Content'),
...