美文网首页
新浪emoji表情使用

新浪emoji表情使用

作者: 热心程序猿黄帅哥 | 来源:发表于2019-03-08 15:08 被阅读0次
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="./jquery.sinaEmotion.css">
</head>

<body>
     <!--被用于注册的textarea必须在同一表单下 -->
    <form class="publish">
        <!-- result用来解析emoji图片用于只读时显示,不能修改该id名-->
        <div id="result"></div>
        <textarea class="content" id="content">欢迎使用jQuery Sina Emotion[呵呵]</textarea><br>
        <input class="face" type="button" value="表情">
        <input class="submit" type="button" value="解析">
    </form>

    <script src="../js/jquery-3.1.0.min.js"></script>
    <script src="./jquery.sinaEmotion.js"></script>
    <script>
        $('.submit').bind({
            click: function () {
                var content = $('#content').val();
                console.log(content)
                $('#result').html(content).parseEmotion();
            }
        });
        $('.face').bind({
            click: function (event) {
                if (!$('#sinaEmotion').is(':visible')) {
                    $(this).sinaEmotion();
                    event.stopPropagation();
                }
            }
        });
    </script>
</body>

</html>

相关文章

网友评论

      本文标题:新浪emoji表情使用

      本文链接:https://www.haomeiwen.com/subject/qfmrpqtx.html