部分js代码
<script> screenFuc(); function screenFuc() { var topHeight = $(".chatBox-head").innerHeight();//聊天头部高度 //屏幕小于768px时候,布局change var winWidth = $(window).innerWidth(); if (winWidth <= 768) { var totalHeight = $(window).height(); //页面整体高度 $(".chatBox-info").css("height", totalHeight - topHeight); var infoHeight = $(".chatBox-info").innerHeight();//聊天头部以下高度 //中间内容高度 $(".chatBox-content").css("height", infoHeight - 46); $(".chatBox-content-demo").css("height", infoHeight - 46); $(".chatBox-list").css("height", totalHeight - topHeight); $(".chatBox-kuang").css("height", totalHeight - topHeight); $(".div-textarea").css("width", winWidth - 106); } else { $(".chatBox-info").css("height", 495); $(".chatBox-content").css("height", 448); $(".chatBox-content-demo").css("height", 448); $(".chatBox-list").css("height", 495); $(".chatBox-kuang").css("height", 495); $(".div-textarea").css("width", 260); } } (window.onresize = function () { screenFuc(); })(); //未读信息数量为空时 var totalNum = $(".chat-message-num").html(); if (totalNum == "") { $(".chat-message-num").css("padding", 0); } $(".message-num").each(function () { var wdNum = $(this).html(); if (wdNum == "") { $(this).css("padding", 0); } }); </script>