//获取百度编辑器的工具类 var domUtils = UE.dom.domUtils; //获取编辑器的坐标 var $ueditor_offset = $("#ueditor_0").offset(); //创建一个临时dom,用于获取当前光标的坐标 var bk_start = ue.selection.getRange().createBookmark().start; //设置临时dom不隐藏 bk_start.style.display = ‘‘; //计算出x坐标 var x = ($ueditor_offset.left + domUtils.getXY(bk_start).x) + "px"; //计算出y坐标 var y = ($ueditor_offset.top + +bk_start.offsetHeight + domUtils.getXY(bk_start).y) + "px"; //移除临时dom $(bk_start).remove();
时间: 2024-11-05 18:48:17