Wrote a QQ expression jquery plug-in (ie7 & amp; ie7 + chrome firefox compatible)

Source: Internet
Author: User

; (Function ($) {$ (function () {$ ('[data-qqmotion-input]'). each (function () {var qm = new qqmotion (this) ;}) var qqmotion = function (e) {var $ e =$ (e ); var $ parent = $ e. parent (); this. $ icon = $ e; // optimize the skin using parent.css ('position', 'relative '); var skin = this. generateSkin (); $ parent. append (skin); this. $ input = $ ('#' + $ e. attr ('data-qqmotion-input'); this. $ panel = $ parent. find ('. qq-motion-panel '); this. $ motionItem = thi S. $ panel. find ('. qq-motion-list '). find ('lil'); this. $ closeBtn = this. $ panel. find ('. qq-motion-close '); this. addAction ();} // open or display panel qqmotion. prototype. toggle = function () {if (! This. $ icon. hasClass ('qq-motion-on') {this. $ panel. show (); this. $ icon. addClass ('qq-motion-on');} else {this. $ panel. hide (); this. $ icon. removeClass ('qq-motion-on') ;}// click the emoticons and enter qqmotion. prototype. input = function (index) {var text = ''; switch (index) {case 0: text = '[Smile]'; break; case 1: text = '[grin]'; break; case 2: text = '[color]'; break; case 3: text = '[daze]'; break; case 4: text = '[satisfied]'; break; case 5: text = '[weeping]'; break; case 6: text = '[Shy]'; break; case 7: text = '[Shut Up]'; break; case 8: text = '[sleep]'; break; case 9: text = '[crying]'; break; case 10: text = '[awkward]'; break; case 11: text = '[angry]'; break; case 12: text = '[naughty]'; break; case 13: text = '[fangya]'; break; case 14: text = '[Surprised]'; break; case 15: text = '[sad]'; break; case 16: text = '[cool]'; break; case 17: text = '[cold sweat]'; break; case 18: text = '[Crazy]'; break; case 19: text = '[cool]'; break; case 20: text = '[Smile]'; break; case 21: text = '[ cute] '; break; case 22: text = '[White Eyes]'; break; case 23: text = '[arrogant]'; break; case 24: text = '[hunger]'; break; case 25: text = '[Sleepy]'; break; case 26: text = '[Frightened]'; break; case 27: text = '[sweaty]'; break; case 28: text = '[Smile]'; break; case 29: text = '[Soldier]'; break; case 30: text = '[struggle]'; break; case 31: text = '[Cursing]'; break; case 32: text = '[doubt]'; break; case 33: text = '[hush]'; break; case 34: text = '[dizzy]'; break; case 35: text = '[Torture]'; break; case 36: text = '[fading]'; break; case 37: text = '[skeleton]'; break; case 38: text = '[Hitting]'; break; case 39: text = '[goodbye]'; break; case 40: text = '[sweat]'; break; case 41: text = '[Nose]'; break; case 42: text = '[applaud]'; break; case 43: text = '[too big]'; break; case 44: text = '[Giggle]'; break; case 45: text = '[left hum]'; break; case 46: text = '[Right hum]'; break; case 47: text = '[yawning]'; break; case 48: text = '[contempt]'; break; case 49: text = '[grievance]'; break; case 50: text = '[crying]'; break; case 51: text = '[Sinister]'; break; case 52: text = '[Kiss]'; break; case 53: text = '[scare]'; break; case 54: text = '[Poor]'; break; case 55: text = '[kitchen knife]'; break; case 56: text = '[watermelon]'; break; case 57: text = '[Beer]'; break; case 58: text = '[basketball]'; break; case 59: text = '[ping-pong]'; break; case 60: text = '[ coffee] '; break; case 61: text = '[Rice]'; break; case 62: text = '[pig head]'; break; case 63: text = '[Rose]'; break; case 64: text = '[fade]'; break; case 65: text = '[show love]'; break; case 66: text = '[Love]'; break; case 67: text = '[heartbroken]'; break; case 68: text = '[Cake]'; break; case 69: text = '[ Lightning] '; break; case 70: text = '[bomb]'; break; case 71: text = '[Knife]'; break; case 72: text = '[ soccer] '; break; case 73: text = '[ladybug]'; break; case 74: text = '[poop]'; break; case 75: text = '[ moon] '; break; case 76: text = '[Sun]'; break; case 77: text = '[gift]'; break; case 78: text = '[hug]'; break; case 79: text = '[strong]'; break; case 80: text = '[Weak]'; break; case 81: text = '[handshake]'; break; case 82: text = '[victory]'; break; case 83: text = '[Fist]'; break; case 84: text = '[seduce]'; break; case 85: text = '[Fist]'; break; case 86: text = '[Bad]'; break; case 87: text = '[love you]'; break; case 88: text = '[NO]'; break; case 89: text = '[OK]'; break;} insertText (this. $ input [0], text); this. toggle ();} // generates the qqmotion of the facial expression skin. prototype. generateSkin = function () {var imgpath = this. $ icon. attr ('data-qqmotion-imgpath'); var str = '<div class = "qq-motion-panel"> '; str + = '

: Https://code.csdn.net/liuyanzhi08/jquery-qqmotion-js

Demo address: http://quchen.cau.edu.cn/jsDev/jquery-qqmotion/


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.