How to wrap selected text with a div in ipad?

依然范特西╮ 提交于 2019-12-22 13:56:09

问题


Its a followup question of this. I'm trying to wrap the selected text in a div using window.getSelection() but its not working in iPad because window.getSelection().rangeCount is 0.

Demo: http://jsfiddle.net/codef0rmer/jE4w5/

Is there any workaround for this to work in iPad?


回答1:


You can use rangy for text selection and highlighting. jQuery Mobile along with backbone.js breaks the page so I used jQuery FastClick plugin



来源:https://stackoverflow.com/questions/11465253/how-to-wrap-selected-text-with-a-div-in-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!