Uncaught TypeError:无法读取materialize.js中未定义的属性“ top”

时间:2018-08-13 06:36:52

标签: javascript jquery materialize

有人可以帮助我克服这个错误吗?

enter image description here

这是脚本:

// usefull for select for example
  $.fn.scrollTo = function(elem) {
    $(this).scrollTop($(this).scrollTop() - $(this).offset().top + $(elem).offset().top);
    return this;
  };

这是错误:

materialize.js:429 Uncaught TypeError: Cannot read property 'top' of undefined
    at m.fn.init.$.fn.scrollTo (materialize.js:429)
    at activateOption (materialize.js:2731)
    at HTMLInputElement.<anonymous> (materialize.js:2720)
    at HTMLInputElement.dispatch (VM44 jquery-1.11.2.min.js:3)
    at HTMLInputElement.r.handle (VM44 jquery-1.11.2.min.js:3)

0 个答案:

没有答案