JavaScript selection/range framework(JavaScript 选择/范围框架)
问题描述
我一直在使用选择/范围对象,因为对于特定的选择/范围内容(甚至超过 DOM),浏览器之间存在大量不一致的情况,我想知道是否有一个框架可以帮助我获得通过他们.
I've been working with selection/range objects, and because to the incredible amount of inconsistencies between browsers for specific selection/range stuff (even more than the DOM) I was wondering if there was a framework that would help me get through them.
推荐答案
(按要求回答;)
看看IERange:
IERange 功能齐全W3C DOM Ranges 的实现Internet Explorer,允许用户编写一个跨浏览器版本的他们的范围操作代码.
IERange is a feature-complete implementation of W3C DOM Ranges for Internet Explorer, allowing users to write one cross-browser version of their range manipulation code.
支持范围 API:
document.createRange()startContainer,startOffset,endContainer,endOffset,commonAncestorContainer,折叠setStart()、setEnd()、setStartBefore()、setStartAfter()、setEndBefore(),setEndAfter(),selectNode(),selectNodeContents(),collapse()insertNode(),surroundContents()extractContents()、cloneContents()、deleteContents()compareBoundaryPoints()、cloneRange()、createContextualFragment()、toString()
document.createRange()startContainer,startOffset,endContainer,endOffset,commonAncestorContainer,collapsedsetStart(),setEnd(),setStartBefore(),setStartAfter(),setEndBefore(),setEndAfter(),selectNode(),selectNodeContents(),collapse()insertNode(),surroundContents()extractContents(),cloneContents(),deleteContents()compareBoundaryPoints(),cloneRange(),createContextualFragment(),toString()
支持选择 API:
- 范围支持(Webkit 样式)
window.getSelection()addRange()、removeAllRanges()、getRangeAt()、toString()
这篇关于JavaScript 选择/范围框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:JavaScript 选择/范围框架
基础教程推荐
- 检查 HTML5 拖放文件类型 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
