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.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
I've written a new range/selection library called Rangy that is similar in concept to IERange but goes quite a lot further.
The core is pretty much complete and currently available to download. I'm currently bugfixing and documenting it and it should be only be a few weeks before a full release.UPDATE 31 August 2011
Rangy is now stable and at version 1.2 (downloads page).
(Made an answer by request ;)
Take a look at IERange:
Supports Range APIs:
document.createRange()
startContainer
,startOffset
,endContainer
,endOffset
,commonAncestorContainer
,collapsed
setStart()
,setEnd()
,setStartBefore()
,setStartAfter()
,setEndBefore()
,setEndAfter()
,selectNode()
,selectNodeContents()
,collapse()
insertNode()
,surroundContents()
extractContents()
,cloneContents()
,deleteContents()
compareBoundaryPoints()
,cloneRange()
,createContextualFragment()
,toString()
Supports Selection APIs:
window.getSelection()
addRange()
,removeAllRanges()
,getRangeAt()
,toString()
fieldselection is a very usable jquery plugin for selection/range manipulation.