那是因为SetCursorPos函数虽然成功了,但是它并没有触发鼠标移动事件(Mouse Move Event),所以菜单不过自动弹出来哈。
基于16个网页-相关网页
创建一个鼠标移动事件 MouseMovedExampleEvent
但是,对拖动的处理必须在文档对象中运行,因为要获得所有鼠标移动事件,而不仅仅是光标在目标对象上时发生的鼠标事件。
The drag handling, however, must be running in the document object, because you want to get all mouse-move events, not just those that might happen with the cursor over the target object.
矩形和文本元素对不同的事件 -- 如移动鼠标和单击 -- 做出反应,产生一种简单的滚动效果。
The rectangle and text elements react to the different events, such as moving the mouse and clicking, to create a simple rollover effect.
它们会随鼠标移动,当键盘事件发生时不消失。
They follow the cursor's movement, and do not disappear when keyboard events occur.
应用推荐