iPad 移动文本区域中的光标
任何人都知道为什么会发生这种情况?在过去的两个小时里,我一直把头撞在桌子上,试图找出 iPad 上光标移动的原因。请观看我的视频:
http://tinypic.com/r/20k6338/7
这是我的 CSS:
#newroar-ipad {
position: fixed;
display: block;
opacity: 0;
left: 5px;
top: 0px;
height: 480px !important;
width: 550px !important;
margin-top: 30px;
pointer-events: none;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFFFFF), to(#CCCCCC));
z-index: 4;
-webkit-border-radius: 5px;
-webkit-box-shadow: 0px 4px 5px #000;
-webkit-transition: -opacity 0.0s ease-out;
-webkit-transition-duration: .4s;
-webkit-transform: translate(0px, -20px);
}
#newroar-ipad.show {
opacity: 1.0;
pointer-events: auto;
z-index: 4;
-webkit-transition-duration: .4s;
-webkit-transform: translate(0px, 15px);
}
#newroar-ipad-content-header {
margin-top: 10px;
z-index: 4;
width: 548px;
height: 55px;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#EBEBEB), to(#CCC));
border: 1px solid #CCC;
}
#newroar-ipad-content {
margin-top: 0px;
margin-left: 2px;
background: none;
top: 0;
width: 542px;
height: 400px;
z-index: 4;
}
.newroar-inputfield {
-webkit-appearance: none;
height: 20px !important;
width: 90%;
margin-left: 18px;
margin-bottom: 10px;
background: #FFF;
color: #666;
font-size: 12px;
border-style: none;
padding: 10px;
-webkit-border-radius: 5px !important;
}
.newroar-textarea {
-webkit-appearance: none;
width: 90%;
height: 120px;
margin-left: 18px;
margin-bottom: 10px;
background: #FFF;
color: #666;
font-size: 12px;
border-style: none !important;
border: none !important;
padding: 10px;
-webkit-border-radius: 5px !important;
-webkit-box-shadow: none !important;
outline: none !important;
}
.newroar-selectfield {
font-size: 14px !important;
height: 30px !important;
width: 300px !important;
margin-left: 18px !important;
margin-top: 25px !important;
margin-bottom: 25px !important;
}
您可以看到我尝试使用 !important 以防它为 CSS 文档中的其他表单元素带来样式,并且我尝试了 -webkit-appearance 来查看它是否可以修复它...但没有效果。 =(
感谢您的任何建议!
Anyone have any idea why this is happening? I've been hitting my head on the desk for the last 2 hours, trying to figure out why the cursor gets displaced on the iPad. Check out my video to see it:
http://tinypic.com/r/20k6338/7
Here is my CSS:
#newroar-ipad {
position: fixed;
display: block;
opacity: 0;
left: 5px;
top: 0px;
height: 480px !important;
width: 550px !important;
margin-top: 30px;
pointer-events: none;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFFFFF), to(#CCCCCC));
z-index: 4;
-webkit-border-radius: 5px;
-webkit-box-shadow: 0px 4px 5px #000;
-webkit-transition: -opacity 0.0s ease-out;
-webkit-transition-duration: .4s;
-webkit-transform: translate(0px, -20px);
}
#newroar-ipad.show {
opacity: 1.0;
pointer-events: auto;
z-index: 4;
-webkit-transition-duration: .4s;
-webkit-transform: translate(0px, 15px);
}
#newroar-ipad-content-header {
margin-top: 10px;
z-index: 4;
width: 548px;
height: 55px;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#EBEBEB), to(#CCC));
border: 1px solid #CCC;
}
#newroar-ipad-content {
margin-top: 0px;
margin-left: 2px;
background: none;
top: 0;
width: 542px;
height: 400px;
z-index: 4;
}
.newroar-inputfield {
-webkit-appearance: none;
height: 20px !important;
width: 90%;
margin-left: 18px;
margin-bottom: 10px;
background: #FFF;
color: #666;
font-size: 12px;
border-style: none;
padding: 10px;
-webkit-border-radius: 5px !important;
}
.newroar-textarea {
-webkit-appearance: none;
width: 90%;
height: 120px;
margin-left: 18px;
margin-bottom: 10px;
background: #FFF;
color: #666;
font-size: 12px;
border-style: none !important;
border: none !important;
padding: 10px;
-webkit-border-radius: 5px !important;
-webkit-box-shadow: none !important;
outline: none !important;
}
.newroar-selectfield {
font-size: 14px !important;
height: 30px !important;
width: 300px !important;
margin-left: 18px !important;
margin-top: 25px !important;
margin-bottom: 25px !important;
}
You can see I have tried using !important in case it was bringing styling for other form elements in the CSS document, and I tried the -webkit-appearance to see if it would fix it... with no avail. =(
Thanks for any advice you may have!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以尝试使用position:absolute,而不是fixed,
因为ios通常将输入框的焦点移动到键盘上方。似乎位置:固定代码将其带回到原来的位置。
can you try using position:absolute , rather than fixed
Because ios usually move the input box in focus , to just above the keypad. Seems like the position:fixed code is bringing it back to its original position.