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 选择/范围框架
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
