Contenteditable setCursorPos(elem,pos),pos = getCursorPos(elem)
有没有人有可行的解决方案来获取或设置内置元素的可满足div的光标位置? 我要做的是创建类似twitter的字段,我将在@ sign上插入。 问题在于浏览器与contenteditable属性差不多,所以我不能依赖它们来插入。 所以我的算法是:
问题2和5.我检查了以下问题:
还有更多......对于setCursorPos(elem,pos),没有可行的解决方案(FF,Chrome,IE) - 无处不在移动到最后或保存和恢复。 我也得到了CursorPosition,但有时在Chrome中它会给出不正确的结果,所以这个函数也很赞赏!
非常感谢!
链接地址: http://www.djcxy.com/p/74329.html上一篇: Contenteditable setCursorPos(elem, pos), pos = getCursorPos(elem)
下一篇: Set caret after creating new element in contenteditable div