0
Q
模糊ipad
A
回答
0
这个答案的答案在这里:https://gist.github.com/shimondoodkin/1081133 基本上,我们创建一个输入元素,它可以正确地注册模糊,并将焦点改变并将其模糊,只要可以理解的div应该模糊。我调整了shimondoodkin的解决方案,完美地工作,正确定位输入元素,以便页面在试图集中输入元素时不会突然滚动。
if(/AppleWebKit\/([\d.]+)/.exec(navigator.userAgent)) {
function getPos(el) {
for (var lx=0, ly=0; el != null; lx += el.offsetLeft, ly += el.offsetTop, el = el.offsetParent) return {x: lx,y: ly};
}
var refocus_prevtarget = null, inp = ce("input", "", document.body); inp.setAttribute("tabIndex","-1"); inp.style.cssText = "width:1px; height:1px; border:none; margin:0; padding:0; position:fixed";
function refocusContentEditable(e) {
var curelement=getEvtSrc(e);
if(refocus_prevtarget) { // if we have a previous element
// if previous element was contentEditable and the next isn't then:
if(refocus_prevtarget.contentEditable == 'true' && curelement.contentEditable !== 'true') {
var p = getPos(refocus_prevtarget); inp.style.left = p.x; inp.style.top = p.y; // change the position of the input element to near the last elem
inp.focus(); inp.blur(); // set caret focus to input el that handles blur correctly
curelement.focus(); // focus the wanted element
}
}
refocus_prevtarget=curelement;
}
aeh(document.body, "touchend", refocusContentEditable); // add global click handler
}
相关问题
- 1. PDFJs在iPAD上的模糊PDF
- 2. IOS8模糊不适用于iPad视网膜模拟器
- 3. 模糊
- 4. iPad应用程序中所有标签的模糊字体
- 5. 在iPad和iPhone上缩放时背景图像模糊
- 6. iPad的Safari浏览器不火的模糊事件
- 7. 用于iPad的几乎空UIView上的模糊布局
- 8. cocos2d在ipad视网膜模糊的游戏图形
- 9. iPad模糊页面加载与音频标记div时
- 10. 在非视网膜iPad上看起来模糊的图像
- 11. 模糊不清的TextView模糊布局
- 12. 高斯模糊着色器不模糊
- 13. Android RenderScript模糊不能模糊文本
- 14. 如何添加模糊增强模糊?
- 15. 如何模糊ListView项目与模糊?
- 16. 模糊div模糊其他div
- 17. 如何模糊iframe以模糊图像?
- 18. 运动模糊图像的去模糊
- 19. AngularJS提交模糊和按键模糊
- 20. 模糊Python模块
- 21. BC30554:'xxxxDBDataContext'模糊
- 22. Services.AddOptions()模糊
- 23. 使UIImageView模糊
- 24. 加速模糊?
- 25. 上模糊
- 26. 模糊UIImages
- 27. 不要模糊
- 28. 模糊PHP
- 29. 模糊匹配
- 30. 模糊NSImageView