//获取百度编辑器的工具类
            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();        

 

相关文章:

  • 2021-11-04
  • 2021-12-25
  • 2022-12-23
  • 2021-12-29
  • 2021-09-19
猜你喜欢
  • 2022-12-23
  • 2021-06-25
  • 2021-12-29
  • 2021-11-04
  • 2021-11-04
  • 2021-11-04
  • 2021-11-04
相关资源
相似解决方案