Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize Wechat chat and Wechat chat expression Editor function by HTML5

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how HTML5 realizes Wechat chat and Wechat chat expression editor function". In daily operation, it is believed that many people have doubts about how HTML5 realizes Wechat chat and Wechat chat expression editor function. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the questions of "how to achieve Wechat chat and Wechat chat expression editor function by HTML5". Next, please follow the editor to study!

Html code snippet:

Send

Photo

Video

Red packet

My collection

The total amount of documents, yuan, red packets, several online people, a total of 186 people. ¥0.00

Js code snippet:

/ /... Long press pop-up menu $("# J__chatMsgList"). On ("longTap", "li .msg", function (e) {var that = $(this), menuTpl, menuNode = $(""); that.addClass ("taped"); that.parents ("li"). Siblings (). Find (".msg"). RemoveClass ("taped"); var isRevoke = that.parents ("li"). HasClass ("me"); var _ revoke = isRevoke? "withdraw": "; if (that.hasClass (" picture ")) {console.log (" picture long click "); menuTpl =" copy collection save as "+ _ revoke +" delete ";} else if (that.hasClass (" video ")) {console.log (" video long click "); menuTpl =" Save as "+ _ revoke +" delete " } else {console.log ("text long press"); menuTpl = "copy collection" + _ revoke + "delete";} if (! $(".wc _ chatTapMenu") .length) {$(".wc _ chatMsg-panel") .append (menuNode.html (menuTpl)); autoPos () } else {$(".wc _ chatTapMenu") .hide () .html (menuTpl) .fadeIn250; autoPos ();} function autoPos () {console.log (that.position () .top) var _ other = that.parents ("li") .hasClass ("others") Css ({position: "absolute", left: that.position (). Left + parseInt (that.css ("marginLeft")) + (_ other? 0: that.outerWidth ()-$(".wc _ chatTapMenu") .outerWidth ()), top: that.position () .top-$(".wc _ chatTapMenu") .outerHeight ()-8}) At this point, the study on "how HTML5 implements Wechat chat and Wechat chat expression editor function" is over. I hope I can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report