【问题来了】HTML怎么实现@功能与emoji表情功能的输入框

问题描述:

HTML怎么实现@功能与emoji表情功能的输入框,效果如下:
在这里插入图片描述

解决方案:

参照 github 上两个开源项目整合实现的
@功能:https://github.com/ichord/At.js
emoji表情功能:https://github.com/eshengsky/jQuery-emoji
直接上主要代码:

<html>
<title>HTML实现@功能与emoji表情功能的输入框</title>
<head>
<script type="text/javascript"  src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.js"></script>
<script  src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<link type="text/css" rel="stylesheet" href="css/atwho/jquery.atwho.css">
<link type="text/css" rel="stylesheet" href="css/emoji/jquery.emoji.css">
<script type="text/javascript"  src="js/atwho/jquery.caret.js" > </script>
<script type="text/javascript"  src="js/atwho/jquery.atwho.js" > </script>
<script type="text/javascript"  src="js/emoji/jquery.mousewheel-3.0.6.min.js" > </script>
<script type="text/javascript"  src="js/emoji/jquery.mCustomScrollbar.min.js" > </script>
<script type="text/javascript"  src="js/emoji/jquery.emoji.js" > </script>
<style type="text/css">
#content_in_messageWall{
    
    min-height: 141px;
	max-height: 141px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgb(0 0 0 / 8%) inset;
    color: #555;
    display: block;
    font-size: 14px;
    line-height: 1.42857;
    padding: 6px 12px;
    transition: border-color .15s ease-in-out 0s,box-shadow .15s ease-in-out 0s;
    width: 98%;
	overflow: auto;
}
/**给div加 placeholder  **/
div[contenteditable]:empty:before{
    
    content: attr(placeholder);
    color: #CCCCCC;
}
div[contenteditable]:focus{
    
    content:none;
}
.msg-list {
    
	margin-top: 20px;
}
.play-line {
    
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 10px;
}

.msg-content .play-line {
    
	display: flex;
	align-items: center;
	justify-content: flex-end;
}
.push-msg-wrap{
    
    padding-left: 300px;
    padding-right
  • 4
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值