0

当序列重复如下时,从 1 到 100 的绑定数字会导致问题。

Mousetrap.bind("1", function(e) {alert(1);});
Mousetrap.bind("11", function(e) {alert(11);});

只有第一个有效。有没有办法绑定从 1 到 100 的所有数字?

4

1 回答 1

0

试试这个要点:https ://gist.github.com/moos/22ee1584833de27f041c

  Mousetrap.bind('numbers', callback) // handle a sequence of 1+ numbers
于 2022-02-21T17:45:08.873 回答