目录

$badge

$badge是提供标记显示、隐藏的服务对象

$badge.showBadge()

$badge.showBadge()该方法用来显示标记

语法

  1. $badge.showBadge(jsonArgs)

参数

  • target:要显示角标的目标控件的id
  • text:角标显示的内容
  • position:显示在target控件的位置 topright | topleft | bottomright | bottomleft
  • margin-top:标记距离默认位置的上边距
  • margin-bottom:标记距离默认位置的下边距
  • margin-right:标记距离默认位置的右边距
  • margin-left:标记距离默认位置的左边距
  • textsize:标记字体大小
  • textcolor:标记字体颜色
  • background:气泡背景色
  • background-image:气泡背景图
  • width:气泡宽度
  • height:气泡高度

实例

  1. $badge.showBadge({
  2. "target" : "image0",
  3. "text" : "1",
  4. "position" : "topright"
  5. });
  6. $badge.showBadge({
  7. "target" : "image0", //要显示角标的目标控件的id
  8. "text" : "1", //角标显示的内容
  9. "position" : "topleft", //显示在target控件的位置 topright | topleft | bottomright | bottomleft
  10. "width" : "35",
  11. "height" : "35",
  12. "background" : "#0000ff",
  13. "textsize" : "20",
  14. "textcolor" : "#000000",
  15. "margin-top" : "20"
  16. });

$badge.hideBadge()

$badge.hideBadge()该方法用来隐藏显示的标记

语法

  1. $badge.hideBadge(jsonArgs)

参数

  • target:要显示角标的目标控件的id

实例

  1. $badge.hideBadge({
  2. "target" : "image1"
  3. });
文档更新时间: 2018-01-15 14:41