1

如何检查光标当前是否显示(即鼠标光标在图表上方)?

这里建议使用:

if (cursor.hidden || cursor.isHiding) {
  // nope, cursor is not there
}

但是,这两个属性总是错误的。见此

在控制台打开的情况下,单击“Get Cursor Info In 2 Seconds”按钮,不要移动鼠标(即保持鼠标光标离开图表以使光标不显示)。一旦 setTimeout 完成,两者都会在控制台中报告为 false。至少有一个应该是真的。

4

1 回答 1

0

hidden应该是isHidden。所以这似乎有效:

if (cursor.isHidden || cursor.isHiding) {
  // nope, cursor is not there
}
于 2019-05-17T19:07:18.307 回答