【发布时间】:2012-10-10 22:26:16
【问题描述】:
我在浏览器文本编辑器中使用 Ace。
editor.on("mousemove", function (e)
{
// use clientX clientY to get row and column locations
});
从 clientX clientY 坐标我需要编辑器上的实际行号和列号。
查看 Ace api 但找不到任何相关内容。
你知道我有什么方法可以做到这一点吗?
谢谢
【问题讨论】:
-
对于任何寻求通用答案的人:
<script>function getCursorPosition() { var p;var editor = ace.edit("editor");p = editor.selection.getCursor();} </script>
标签: javascript ace-editor mouse-cursor