6

我有一个带有几个图标的标题,我想在带有通知计数的徽章图标等图标中动态显示气泡计数。我们如何在 jquery mobile 中进行操作?我在 jquery mobile 中搜索气泡计数,但它目前可用于 listview,但我想在图标右上角显示计数,如 iOS 通知计数。找到下面需要在jquery mobile中实现的徽章图标的参考网址,网址:http ://en.wikipedia.org/wiki/Apple_Push_Notification_Service

4

1 回答 1

5

这可以通过 CSS 来完成。

HTML

<div class="icon">
    <span class="count">12</span>
</div>

CSS

.icon {
   width: 50px;
   Height: 50px;
   background: url(/images/icon.png)
}

.icon .count {
    background:#ff0000;
    position: absolute; 
    top: -8px;
    Right: -8px;
    min-width:14px;
    height: 14px;
    color:#ffffff;
    border-radius: 50%;
    padding: 2px;
    text-align: center;
    font-size: 12px;
}

现在您所要做的就是弄清楚何时将数字插入“气泡”

编辑:“图标”类点丢失。

于 2012-10-13T05:45:52.177 回答