本文实例为大家分享了js仿聊天室聊天记录的具体代码,供大家参考,具体内容如下
参考样式(css自定义聊天窗口样式):http://xiazai.jb51.net/201612/yuanma/css3chatstyle(jb51.net).rar
功能描述:
1. 用户在微信公众号里发送内容,参与活动
2. 后台提供类似聊天室的窗口显示用户实时发布的内容
界面截图:
代码:
body {
padding: 0;
margin: 0;
background: -moz-linear-gradient(-45deg, #183850 0, #183850 25%, #192c46 50%, #22254c 75%, #22254c 100%);
background: -webkit-linear-gradient(-45deg, #183850 0, #183850 25%, #192c46 50%, #22254c 75%, #22254c 100%);
background-repeat: no-repeat;
background-attachment: fixed;
}
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
border-radius: 10px;
background-color: rgba(25, 147, 147, 0.1);
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background-color: rgba(25, 147, 147, 0.2);
}
.chat-thread {
margin: 24px auto 0 auto;
padding: 0 20px 0 0;
list-style: none;
overflow-y: scroll;
overflow-x: hidden;
}
.chat-thread .li {
position: relative;
clear: both;
display: inline-block;
padding: 16px 40px 16px 20px;
margin: 0 0 20px 0;
font: 16px/20px 'Noto Sans', sans-serif;
border-radius: 10px;
background-color: rgba(25, 147, 147, 0.2);
}
/* Chat - Avatar */
.chat-thread .img {
width: 50px;
height: 50px;
border-radius: 50px;
content: '';
float:left;
}
/* Chat - Speech Bubble Arrow */
.chat-thread li:after {
position: absolute;
top: 15px;
content: '';
width: 0;
height: 0;
border-top: 15px solid rgba(25, 147, 147, 0.2);
}
.chat-thread li:nth-child(odd) {
animation: show-chat-odd 0.15s 1 ease-in;
-moz-animation: show-chat-odd 0.15s 1 ease-in;
-webkit-animation: show-chat-odd 0.15s 1 ease-in;
float: right;
margin-right: 80px;
color: #0AD5C1;
}
.chat-thread li:nth-child(odd):before {
right: -80px;
}
.chat-thread li:nth-child(odd):after {
border-right: 15px solid transparent;
right: -15px;
}
.chat-thread li:nth-child(even) {
animation: show-chat-even 0.15s 1 ease-in;
-moz-animation: show-chat-even 0.15s 1 ease-in;
-webkit-animation: show-chat-even 0.15s 1 ease-in;
float: left;
margin-left: 80px;
color: #0EC879;
}
.chat-thread li:nth-child(even):before {
left: -80px;
}
.chat-thread li:nth-child(even):after {
border-left: 15px solid transparent;
left: -15px;
}
.chat-window {
position: fixed;
bottom: 18px;
}
.chat-window-message {
width: 100%;
height: 48px;
font: 32px/48px 'Noto Sans', sans-serif;
background: none;
color: #0AD5C1;
border: 0;
border-bottom: 1px solid rgba(25, 147, 147, 0.2);
outline: none;
}
/* Small screens */
@media all and (max-width: 767px) {
.chat-thread {
width: 90%;
height: 500px;
}
.chat-window {
left: 5%;
width: 90%;
}
}
/* Medium and large screens */
@media all and (min-width: 768px) {
.chat-thread {
width: 70%;
height: 500px;
}
.chat-window {
left: 25%;
width: 50%;
}
}
@keyframes show-chat-even {
0% {
margin-left: -480px;
}
100% {
margin-left: 0;
}
}
@-moz-keyframes show-chat-even {
0% {
margin-left: -480px;
}
100% {
margin-left: 0;
}
}
@-webkit-keyframes show-chat-even {
0% {
margin-left: -480px;
}
100% {
margin-left: 0;
}
}
@keyframes show-chat-odd {
0% {
margin-right: -480px;
}
100% {
margin-right: 0;
}
}
@-moz-keyframes show-chat-odd {
0% {
margin-right: -480px;
}
100% {
margin-right: 0;
}
}
@-webkit-keyframes show-chat-odd {
0% {
margin-right: -480px;
}
100% {
margin-right: 0;
}
}
.credits{
text-align:center;
margin-top:35px;
color: rgba(255, 255, 255, 0.35);
font-family: 'Noto Sans', sans-serif;
}
.credits a{
text-decoration:none;
color: rgba(255, 255, 255, 0.35);
}
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>红包详情</title> <meta name="keywords" content="keyword1,keyword2,keyword3"> <meta name="description" content="this is my page"> <meta name="content-type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> <script src="/UploadFiles/2021-04-02/jquery-1.7.2.min.js">String sql = "SELECT c.*,u.nickName,u.headImg " + "from wx_costomersendmessage c,bid_user u " + "where c.openId=u.openId and c.id>"+maxId +" order by c.id Limit 0,"+limit;以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
标签:
js聊天室聊天记录,js聊天记录
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
白云城资源网 Copyright www.dyhadc.com
暂无“JavaScript仿聊天室聊天记录”评论...
更新日志
2025年10月27日
2025年10月27日
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]
