如何在鼠标指针处打开 Kendo window
How to open a Kendo window at mouse pointer
有没有办法在鼠标指针处打开一个KendoUIWindow?
我在Telerik demo for the Window API中看到,我可以在页面中央打开它,但我想在鼠标指针上打开它。
首先,将当前鼠标位置保存在某处:
var currentMousePos = { x: -1, y: -1 };
$(document).mousemove(function(event) {
currentMousePos.x = event.pageX;
currentMousePos.y = event.pageY;
});
然后,当打开您的 Kendo Window:
$("#window").closest(".k-window").css({
top: currentMousePos.y,
left: currentMousePos.x
});
有没有办法在鼠标指针处打开一个KendoUIWindow?
我在Telerik demo for the Window API中看到,我可以在页面中央打开它,但我想在鼠标指针上打开它。
首先,将当前鼠标位置保存在某处:
var currentMousePos = { x: -1, y: -1 };
$(document).mousemove(function(event) {
currentMousePos.x = event.pageX;
currentMousePos.y = event.pageY;
});
然后,当打开您的 Kendo Window:
$("#window").closest(".k-window").css({
top: currentMousePos.y,
left: currentMousePos.x
});