jga*_*fin 3 jquery jquery-plugins
任何人都可以建议一个插件,可以处理文本区域(跨浏览器)中的文本选择?
我正在寻找一个插件,它可以:
(IE createTextRange在其他浏览器使用时使用setSelectionRange.应该存在一个可以执行上述操作的插件,这样我就不必重新发明轮子了.)
jQuery Fieldselection: https ://github.com/localhost/jquery-fieldselection
请参阅:https: //github.com/localhost/jquery-fieldselection/blob/master/jquery-fieldselection.js
Implements: getSelection,replaceSelection
不实现: currentSelection
Rangy: Implements: getSelection,ReplaceSelection,CurrentSelection
(注意:不是jquery插件,但仍广泛适用)
跨浏览器的JavaScript范围和选择库.它提供了一个简单的基于标准的API,用于在所有主流浏览器中执行常见的DOM范围和选择任务,从而在Internet Explorer和符合DOM的浏览器之间抽象出这种功能的完全不同的实现.
似乎实现了你想要的,对于demo来说:http: //rangy.googlecode.com/svn/trunk/demos/core.html
http://code.google.com/p/rangy/
另请参见:Jquery:非textarea元素的selectionStart
Rangyinputs 一个jquery插件,提供与Rangy类似的功能,除了输入而不是任意DOM元素.
一个小型跨浏览器JavaScript库,用于获取和操作HTML元素中的选择.
演示:http://rangyinputs.googlecode.com/svn/trunk/demos/textinputs_jquery.html
项目:http://code.google.com/p/rangyinputs/