freedemon
freedemon
  • 发布:2016-08-28 15:46
  • 更新:2017-12-15 16:18
  • 阅读:1838

(求指教)弹出表情框,能使页面内容上移,效果类似弹出软键盘

分类:MUI
IM

我做了个Im聊天界面,现在的问题就是表情框弹出需要然后像弹出软键盘一样可以将页面内容上移。
im界面我参考了hello mui的im-chat界面,但是其中

ui.areaMsgList.scrollTop = ui.areaMsgList.scrollHeight + ui.areaMsgList.offsetHeight ;

并没有效果。
无比恳切请求懂的朋友指教一番,本人无比感谢。

2016-08-28 15:46 负责人:无 分享
已邀请:
freedemon

freedemon (作者) - 得于社区,反哺社区

已自己解决。

zapoi

zapoi

旁友,你好我现在也遇到了这样的问题,想要点击按钮后弹出一块区域用于语音输入,然后上面的mui-content区域要上移,请问能分享下解决的思路吗

vosome

vosome

请问怎么解决的?能否提供代码 感谢

wangyudong

wangyudong

state.footerPushCenter.show = function() {  
                        ui.boxMsgText.blur();//隐藏软键盘  
                        var height = ui.footerPushCenter.offsetHeight;  
                        if(height == undefined || height == null || height == 0 || height == "0") {  
                            height = ui.footerPushCenter.clientHeight;  
                        }  

                        if(height == undefined || height == null || height == 0 || height == "0") {  
                            height = 214;  
                        }  

                        ui.footer.style.bottom = height + "px";  
                        ui.footerPushCenter.style.bottom = "0px";  
                        state.footerPushCenter.isHide = false;  
                        if(state.winHeight < ui.body.clientHeight) {  
                            state.winHeight = ui.body.clientHeight;  
                        }  

                        ui.areaMsgList.style.height = state.winHeight - height - 45 + "px";  
                        ui.areaMsgList.scrollTop = ui.areaMsgList.scrollHeight + ui.areaMsgList.offsetHeight;  

                    };  

                    state.footerPushCenter.hide = function() {  
                        ui.footer.style.bottom = "0px";  
                        state.footerPushCenter.isHide = true;  
                        ui.footerPushCenter.style.bottom = "-500px";  
                        ui.areaMsgList.style.height = "100%";  
                        ui.areaMsgList.scrollTop = ui.areaMsgList.scrollHeight + ui.areaMsgList.offsetHeight;  
                    };  

该问题目前已经被锁定, 无法添加新回复