如何使用scrollTo

时间:2016-04-28 20:08:04

标签: javascript backbone.js scrollto

我的package.json:

      ...
      "scripts": {
        "build": "gulp && webpack",
        "webpack": "webpack"
      },
      ...
      "dependencies": {
        "scrollto": "git://github.com/flesler/jquery.scrollTo.git" // ???
      }
      ...

我的骨干观点:

const Backbone = require('backbone');
const _ = require('underscore');
const $ = require('jquery');
require('scrollto'); // ???
...
  _handleError(error) {
    if (error) {
      $('#header').focus();
      $(window).scrollTo('#header'); // ????
    } else {
      ...
    }
  },
...

命令:

gulp && webpack

错误:

Module not found: Error: Cannot resolve module 'scrollto' in /home/me/src/myproject/src/dashboard/static/js/views/query

有什么遗漏或错误吗?

由于

更新

修正:     “jquery.scrollto”:“^ 2.0.0”

require('jquery.scrollto');

0 个答案:

没有答案