不支持不连续选择

编程入门 行业动态 更新时间:2024-10-15 02:26:06
本文介绍了不支持不连续选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试bootstrap-wysihtml5-rails,我正在使用Twitter Bootstrap 2

I am trying bootstrap-wysihtml5-rails, I am using twitter bootstrap 2

但是当我得到图像中的结果时,出现错误:

but when I get this result as in the image, and the error:

Discontiguous selection is not supported.

我试图这样window['rangy'].initialized = false;:

<script type="text/javascript"> $(document).ready(function(){ window['rangy'].initialized = false; $('.wysihtml5').each(function(i, elem) { $(elem).wysihtml5(); }); }) </script>

但是我仍然遇到相同的错误,我可以忍受它,但是似乎它像图像中的一样破坏了编辑器的按钮,任何人都可以帮忙吗?

But I still get the same error, I could live with it, but it seems that it breaks the buttons of the editor as in the image, any one can help?

推荐答案

只需在代码后添加 window.getSelection().removeAllRanges(); 即可.

Just add window.getSelection().removeAllRanges(); after your code, this will do the magic.

更多推荐

不支持不连续选择

本文发布于:2023-06-11 00:14:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/622025.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不支持   不连续

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!