<a onclick = gomessage (); style = largeur: 60px; hauteur: 100%; couleur: blanc; fond: transparent; href = # class = easyui-linkbutton data-options = iconcls: 'fa fa-bell-o fa-2x', taille: 'grand', iconalign: 'top'> 消息 <span id = msgnum class = ii> 4 < / span> </a>CSS 代码 :
/ * 角标 * / .ii {affichage: aucun; Contexte: # F00; Border-Radius: 50%; Largeur: 20px; hauteur: 20px; En haut: 5px; Droite: 0px; Position: absolue; Texte-aligne: Centre; Couleur: #FFF; Z-Index: 99999; }JS 代码 :
fonction ajaxa () {$ .ajax ({type: post, dataType: json, async: false, url: $ {pagecontex data) {if (data! = null) {if (parseInt (data)> 10) {$ (# msgnum) .show (); $ (# msGnum) .Text (parseInt (data)); (données)> 0) {$ (# msgnum) .show (); $ (# msgnum) .Text (parseInt (data);} else {$ (# msgnum) .hide (); fonction(){ } }); }:
以上所述是小编给大家介绍的 html 在消息按钮上增加数量角标的实现代码 , 希望对大家有所帮助 , 如果大家有任何疑问请给我留言 , 小编会及时回复大家的。在此也非常感谢大家对 vevb 武林网网站的支持!