1
有沒有辦法在鼠標指針處打開Kendo UI窗口?如何在鼠標指針處打開Kendo窗口
我可以在Telerik demo for the Window API中看到,我可以在頁面中心打開它,但是我想用鼠標指針打開它。
有沒有辦法在鼠標指針處打開Kendo UI窗口?如何在鼠標指針處打開Kendo窗口
我可以在Telerik demo for the Window API中看到,我可以在頁面中心打開它,但是我想用鼠標指針打開它。
首先,保持當前鼠標的位置存儲的地方:
var currentMousePos = { x: -1, y: -1 };
$(document).mousemove(function(event) {
currentMousePos.x = event.pageX;
currentMousePos.y = event.pageY;
});
然後,打開你的劍道窗口時:
$("#window").closest(".k-window").css({
top: currentMousePos.y,
left: currentMousePos.x
});
偉大的作品!由於我最近剛剛加入了stackoverflow,因此我沒有足夠的聲望來投票回答你的答案,但請記住我的+1 –