ueditor中右键内容超出iframe,如何让超出的部分显示?

ueditor富文本编辑器放在iframe中,右键的时候超出了iframe,有没有办法让右键所有内容从iframe中显示出来
image.png

阅读 1.9k
2 个回答

ueditor好像不维护了吧,那么只能从源码去解决,弹框生成的时候计算位置是否超出document,超出的话移动位置

我的方法是给菜单加上滚动条,监听右键事件,判断超出可视范围,调整高度。
image.png

miniEditor.ready(function () {
    $(miniEditor.editor.body).bind("contextmenu", function () {
        setTimeout(function () {
            var ec = $('.edui-contextmenu');
            var bo = $('body');
            var height = ec.height() - (ec.position().top + ec.height() - bo.height());
            if (height > 0) {
                ec.css({
                    'overflow-y': 'auto',
                    'height': height
                })
            }
        })
    })
});
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题