Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 13th, 2012  |  syntax: None  |  size: 1.27 KB  |  hits: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Increment Badge Count
  2. jQuery.fn.add = function() {
  3.  
  4.     var Bnumber = $(this).find(".B_Add");
  5.  
  6.     if (Bnumber) {
  7.         Bcount = parseInt(Bnumber.html()) + 1;
  8.         $(this).find("div.B_Add").remove();
  9.         $(this).parent().find(".B_List").append('<div class="Badge B_Add">'+ Bcount +'</div>');
  10.  
  11.     } else {
  12.         $(this).find(".B_List").append('<div class="Badge B_Add">1</div>');
  13.     }
  14. }
  15.        
  16. jQuery.fn.add = function() {
  17.     if ($(this).find(".Badge").hasClass(".B_add")) {
  18.         bCount = parseInt($(this).find(".B_add").text());
  19.         $(this).find(".B_add").remove();
  20.         $(".OPT .B_list").append('<div class="Badge B_add">'+(bCount+1)+'</div>');
  21.     } else {
  22.         $(".OPT .B_list").append('<div class="Badge B_add">0</div>');
  23.     }
  24. }
  25.        
  26. jQuery.fn.add = function() {
  27.  
  28.     var Bnumber = $(".B_Add");
  29.  
  30.     if (Bnumber) {
  31.         var Bcount = parseInt(Bnumber.html()) + 1;
  32.         Bnumber.html(Bcount);
  33.     } else {
  34.         $(this).find(".B_List").append('<div class="Badge B_Add">1</div>');
  35.     }
  36. }
  37.        
  38. Bcount = parseInt(Bnumber.text()) + 1;
  39.        
  40. jQuery.fn.add = function() {
  41.     var badge = $('.B_Add', this);
  42.  
  43.     if (badge.length) {
  44.         badge.html(Number(badge.html()) + 1);
  45.     } else {
  46.         $('.B_List', this).append('<div class="Badge B_Add">1</div>');
  47.     }
  48. }