Xin chào các bạn, đã đến với blog mình ở bài viết này mình xin chia sẻ cách chèn biểu tượng cảm xúc facebook dưới phần bình luận của blogger. cái này đang được rất nhiều bạn sử dụng nghe qua thôi đã thấy đã rồi nhỉ. Chúng ta bắt đầu vào thực hành nào
Bước 1 : dán đoạn code bên dưới vào trước thẻ <data:blogTeamBlogMessage/>
<div class='comment_emo_list'>
<div class='item'>
<img class='comment_emo' src='https://i.imgur.com/H7SWQsD.png'/> <span>:)</span>
</div>
<div class='item'>
<img class='comment_emo' src='https://i.imgur.com/QydiDcj.png'/> <span>:))</span></div>
<div class='item'> <img class='comment_emo' src='https://i.imgur.com/4QpUJ7T.png'/> <span> :D </span> </div> <div class='item'> <img class='comment_emo' src='https://i.imgur.com/chVQI19.png'/> <span> =)) </span> </div>
<div class='item'>
<img class='comment_emo' src='https://i.imgur.com/IUBKZFX.png'/> <span> :( </span> </div><div class='item'>
<img class='comment_emo' src='https://i.imgur.com/wYq3V4m.png'/> <span> :(( </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/zfqEdJh.png'/> <span> :o </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/ktlACZO.png'/> <span> ^_^ </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/OIechYl.png'/> <span> ^-^ </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/bEMACZ2.png'/> <span> /-f </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/9UL3vL5.png'/> <span> ^.^ </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/QmDOjvi.png'/> <span> /-g </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/oxuCxpe.png'/> <span> ;) </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/sHjwi1T.png'/> <span> -_- </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/uncDMT1.png'/> <span> =_= </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/Hasg5Sz.png'/> <span> /-r </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/h4xKlpM.png'/> <span> -.- </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/UWXDll8.png'/> <span> :p </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/RyqEJmV.png'/> <span> /-o </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/IFRpPun.png'/> <span> /-hi </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/avVQxI0.png'/> <span> /-ok </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/4gZgLxa.png'/> <span> /-clap </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/hCxEamY.png'/> <span> (y) </span> </div> <div class='item'>
<img class='comment_emo' src='https://i.imgur.com/tVPSoZY.png'/> <span> (3) </span> </div> </div>
<style>
.comment_emo_list{background: #069999;(66, 103, 178);color:white;text-align:center;clear:both;float:left;border-radius:10px}.comment_emo_list .item{float:left;text-align:center;height:50px;width:67.9px;margin:0;padding:10px 0 15px;transition:.33s;border-radius:50px}.comment_emo_list .item:hover{background:#069999;}.comment_emo_list .item:hover{user-select:none;-moz-user-select:none;}.comment_emo_list span{user-select:none;-moz-user-select:none;display:block;font-weight:500;font-size 10px;letter-spacing:0;color:#c7c7c7;transition:.33s}img.comment_emo{width:25px;height:25px;pointer-events:none;-webkit-user-select:none}
</style>
- Các bạn chỉnh màu theo ý các bạn :
- Màu khung viền: background:#069999;(đổi 069999 thành màu bạn thích)
- Màu khi rê chuột vào icon : {background:#069999;}(đổi 069999 thành màu bạn thích)
- Màu chữ : color:#c7c7c7; (đổi c7c7c7 thành màu bạn thích)
- Xem mã màu : tại đây
<script type='text/javascript'>Lưu ý : ảnh thứ 2 các bạn phóng to lên xem cho rõ cái thẻ nha, thông cảm photoshop cùi nên ảnh hơi mờ nếu các bạn không thích icon đấy có thể lên google search rồi tự dán vào nhé (icon là hình ảnh nhé)
//<![CDATA[
// Emoticons
function replaceText(){if(!document.getElementById){return;}
bodyText = document.getElementById("comments");
theText = bodyText.innerHTML;
theText = theText.replace(/:\)\)/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzvISNqa-sk1-_F0MXHSJKo0ICLvZ2QTyTTy_EaUbX0uhj1nQ_e0AhM19Ce8jgc9KBNSXXDxvEmfTFhg8ZyEDK3ScnVNfoqZaetufLUsdth0qkAOrBqFl-WSJHp1ooZFuBySfZeKlc1ikv/s1600/1-min.png'/>");
theText = theText.replace(/:\)/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoIR-wiSTu3Cy0bBTWWTxdvcemui1ZMSQfRu8jr_p_DZyvCmz7HZUJUjK0XqIo-YUBmvMyuqw7E3jlJNg3H0rGLd2Pu2yPvT0puHYxWareHWqTz0RAK8KZFUYbScikQU1SPETNzk0ixaQ/s1600/Icon-Blogspot---NNQ-min.png'/>");
theText = theText.replace(/:\*/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyfBXYDymEiIiwIHQ56HmLaZdnQ20ykDKknzH1wQeRktokdDz4-w8TN4aVdhOkiA2kS1WVv2G3s5pDeDidGXA3bC2iBeAMj-XzFjEICQbWWlCTyolwtBZkVUeIZseY9xpZNRX_MCFFgWnf/s1600/2-min.png'/>");
theText = theText.replace(/:v/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOlie_BpsDpG5yR-WRMyZ4BQhTqTXgqrLH2XScY7H2vkMb4HMkfF7hIlx5A8zFraf-12kAMdzAOiLHurFJ641XIFOB0J2GD6Pq2B_LvZZNxMZhOM-pzHEb6QhnrUXHJ5ujDVMk3AtgSqAd/s1600/3-min.png'/>");
theText = theText.replace(/:thuglife/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimOOKVS1csUwZoDxcEH41VQWBqjy4nB_txBPccSYknMIynRCdKhFm7tNSq2Jm-BEABYEEnNJhcT3dS8a8YS9fBGfc1qDMs1E6GsCo4ZtVkWYwbSWmaYIG7KF5WV3zgAFsPH5BZyBjkkPSV/s1600/4-min.png'/>");
theText = theText.replace(/;\//gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK1qE-_SqNPDvmsxJYiccYyYgOyQhas2SPHRH9aO0rf2aYEdKYTih_vJTNEUW5k5G_Dz60t7gBfQAfF2aw7aghsFPm5rSWMLX1zqrB612jqUobSDJdSNSxCIav4vBEE8atQXxW4bFZkzn1/s1600/5-min.png'/>");
theText = theText.replace(/:D/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7JAW2VpGtVBKhyphenhyphen4euIozWdPDZKt-vsqigq9kXpolK8bKefyd8J8i6MmYZyv2sLzjquUCd77rvFpMPiayET1ZyGG0vH15VeI5IE-Fz56StM1RVAZH5HwwpjdMBK20K1xbVaAn-uGsbGPyV/s1600/6-min.png'/>");
theText = theText.replace(/:P/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirlZ2ameMVRAoGW-n_qM2CmsL92KMm7jcqnlt_9i_YVrQfQitPGYHdsGt6QLI38Mp5ZTSvFq_LF0hv6V8jmIfHgvT7jTbCNwlpLGOZAh2uvO4V6GPjhO_FFOXV6Wwm7XAORenomz0i6XAj/s1600/7-min.png'/>");
theText = theText.replace(/:angry/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEP3A_69Pn1UuBAEF7DCK008tWoSUl1xerYJ-hTtMlytsWT-jH5ZDFkzj2ykjuJ2hx_W_9f41gFF9hC7Z_xCsIuMiAHdlPIfb__cw2fPswCs9NWISK3cCaxL8AN-nJ7JcyAwanZPZ6LFPO/s1600/8-min.png'/>");
theText = theText.replace(/@@/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWNIsMAOXk-pfqO4OJNhE-jkA7JUsluTqGu7ZRrnyEsr6Ij6dI8xJ38ElUKH2fX33Jbb5Whhnfuco-m6YrikQTSOwJVmMsWhAga6J9swbV-oPZgiMN_RkoVjEhWvk5imZSizvS0tm5sTqz/s1600/9-min.png'/>");
theText = theText.replace(/:\(/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUc8Eb1tTZwf_VCi0li614zrESArxCcXX2ym2oNU7wN0fZQEomdctIToPzfjJqr1P9NTRBwPXJmUEvAg8YHbXDzuujoLm14ZAKC_GTitFYRtlfbiyfiBYJlatziN-0GEGtahq7LVwIe8HE/s1600/10-min.png'/>");
theText = theText.replace(/O\.o/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR5svNi-QkCoWVUK62F-y1LvEmiKZSMuHMgRA0qnzehvVmppNF5XUgra0GJKkdTM_RN-Z-mWxnvE7-74P1pYMRyo9fbMN4-2HU9und2KCjGcUIw705ocZHH3nusHohF9ZVqS3ngP93Ig3q/s1600/11-min.png'/>");
theText = theText.replace(/-_-/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUm0rJ92OyShdp7CNs6q8skdcFIhFvInSkTqnZtxglVCZJKRzo0ZqrMxrOjMbcesnu2KC5kJWfdPonfJ3hojmPP9C2O9VGB6vl-skbI45UbmstA1KrHJJNfAusCTXk-fftZ2Rgdfu1xZal/s1600/12-min.png'/>");
theText = theText.replace(/zzz/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8MuR3g0Wrv6_5MUzIx5VmfcqcoDW6w7hIbvfnc-GEN_UQTPYHWlphVsLQO_cFllRg177jZY8mONtJ9T3IfQFQ-sgSoLQlm_e4V2Dvg88CaoEHuKAtjHp0tkX5aRe14AzVnNzJvqelHDAn/s1600/13-min.png'/>");
theText = theText.replace(/T\.T/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEeQpY9InDoiJ5ioFQb2fScBKCgcZiOo_BPkqUBejn-fyhUTxcjihzBS-dKPk_ln6ravExWrBzKOweAheI29AKRn6JnxMBMXCJnmalxzxEFvseVSp8zoWHlJ0INLIa3yh-aopjrKZ_3j7x/s1600/14-min.png'/>");
theText = theText.replace(/:x/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj841_JKPG30aBviWhLGCMu201tUg3tJILzfvlgZV6SOZhrr-FElZLWlSd18ppXYuZB_xKbCDnmNK7Ipt_70dmhB1VjEWLSg2igzUaeIifuJ87olFCY3VMHiu0l_p1X3vTGKtIJvRDJWrn8/s1600/15-min.png'/>");
theText = theText.replace(/:3/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfnVKPxsumT27bnvQCI31baChOtmwThcWIiW5lQVW_dntsKtxAgV8cHY_-lGC8lGHCF0EasF3bLX-c19_P5OBJaVt-pZuAsX8EOTKK59ERt8krSulnHgHS8lxSJ1WbF2bJdE6tBtNfxjRM/s1600/16-min.png'/>");
theText = theText.replace(/<3/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZLMODs0EOvw239u4bJ68PEHUvkJTLwODwh4__ikJavaCN3n0D-dsiuTkYDrjvw0GDw5paPr-u4oCtnA1itx2A5DtLo9v0X3Px9FP7F6-cYdqDwIebzetamRtGq1w_97ZwFrgXFzT8OWeR/s1600/17-min.png'/>");
theText = theText.replace(/\(Y\)/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm9SR1JEFebDtWyhJNgYJAklA4z_NNcr32jC3_-jjLAa0q7lRQLtX6ul5C5u66e4ZrawMbSn4WlJ-vjsjx93OWAvylBi03t1O3CtNODwoXbPfE95kFkggOwQo9PSwK4hEPTalCKBznUWnX/s1600/like-min.png'/>");
theText = theText.replace(/\(3\)/gi, "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVJ4koOlGup5eTJewqw3etNv-r-zrGOtEbHq71zUbmv88XEziyujNuzkTjKpx5mlaenCMDOSWue6_XGtHR4y3dqQX4XMDSfZZgL3CO_tHXv6dgKM6OORyxF-n_wbljdJBeVZM5_XMBJHA/s1600/Logo-Tr%25C3%25A1i-Tim-Blogspot---NNQ-min.png'/>");
bodyText.innerHTML = theText;
}replaceText();
//]]>
</script>
Lời kết :
cái này chưa có trên blog của #NgôVănTuấn - chỉ đơn giản vài bước thao tác là bạn đã có biểu tượng cảm xúc facebook rồi, rất tuyệt vời đúng không nào, nếu thấy hay thì share cho mình nha.Chúc các bạn thành công !
Source: #NgôVănTuấn