【发布时间】:2019-11-03 23:18:36
【问题描述】:
我有一个聊天机器人窗口,必须将其放置在固定的右下角。我已将 CSS 设置放在下面,用于固定定位和视口设置。
CSS 中的聊天窗口固定在右下角,底部有一个文本框。
在 Android 设备中,当该文本框处于焦点位置时,软键盘将出现在文本框上方,而上方的 movnig 网页和定位文本框位于键盘上方则没有正常行为。所以用户看不到他们正在输入的内容。
当我将聊天窗口的 CSS 位置更改为绝对位置时,焦点键盘正常工作。但是,如果滚动没有焦点,整个聊天窗口会向上移动,而不是固定在右下角。
我需要修复这两种情况,以获得焦点的软键盘的正常行为以及固定定位。
请参考以下代码sn-ps,如果能帮忙解决就好了。
@viewport {
min-width: device-width ;
zoom: 1.0 ;
initial-scale:1.0;
maximum-scale:1.0;
user-scalable:1.0;
}
@-ms-viewport {
min-width: device-width ;
zoom: 1.0 ;
initial-scale:1.0;
maximum-scale:1.0;
user-scalable:1.0;
}
#live-chat {
display:none;
bottom: 0;
right: 0;
position: fixed;
width: 99% !important;
max-width:350px;
max-height:100vh;
background: #e9e9e9;
color: #eae2e2;
font: 100%/1.5em "Droid Sans", sans-serif;
margin: 0;
z-index: 10000; box-shadow: 0px 0px 20px 4px #ccc;
}
<div id="live-chat-container">
<div id="live-chat">
<header class="clearfix">
<a href="javascript:void(0);" onclick="hidechat();" class="chat-close">x</a>
<h4> <img src="https://www.xxxx.com/chat/cf-icon.png" width="32px" style="display:inline;vertical-align:middle;"> Chat with Us</h4>
<span class="chat-message-counter">3</span>
</header>
<div class="chat">
<div class="chat-history">
</div> <!-- end chat-history -->
<p class="chat-feedback" style="display:none;">Your partner is typing?</p>
<form action="#" method="post" onsubmit="return chatsend();">
<fieldset class="cbtgroup">
<input type="text" placeholder="Type your message?" id="cbt" autocomplete="off"><input type="submit" value="»" class="cbt" id="cbtbtn">
</fieldset>
</form>
<div style="font-size:xx-small;text-align:center;"><a href="https://www.xxxx.com" target="_blank">Powered by xxx.com</a></div>
</div>
</div> <!-- end live-chat -->
【问题讨论】:
标签: android css android-keypad