Page 2 of 2
How do I add badges to buttons?
Posted: Fri Jun 13, 2014 10:09 am
by Kateryna Grynko
Hi Adam,
Sorry, not sure I understand. What do you mean by 'make the class visible'?
To increment badge you can store a value in localStorage, and then use it:prevar myValue= parseInt(localStorage.getItem("myValue"));
$("[name=mobilenavbaritem_118]").before('span class="badge"'+myValue+'/span');
localStorage.setItem("myValue", myValue + 1);/pre
How do I add badges to buttons?
Posted: Fri Jun 13, 2014 3:00 pm
by adam griffin
By default the class display is none. I would like to make it change from none to shown using javascript when clicking a button or from a list service success
How do I add badges to buttons?
Posted: Fri Jun 13, 2014 4:15 pm
by Evgene Karachevtsev
Hello Adam,
You may use this JS for display:
code$(".badge").css("display","block");
такой чтоб скрыть:
$(".badge").css("display","none"); /code
How do I add badges to buttons?
Posted: Fri Jun 13, 2014 5:30 pm
by adam griffin
The badge is not adding.Instead it is just placing beside each other also its not adding to the badge number
How do I add badges to buttons?
Posted: Fri Jun 13, 2014 7:39 pm
by Evgene Karachevtsev
Adam,
Please clarify, how do you add this text in badge. Please try like this:
code$(".badge").html("5");/code
How do I add badges to buttons?
Posted: Mon Jul 13, 2015 2:49 am
by She
Hi Evgene,
this badge is possible in button component?
Thank you.
How do I add badges to buttons?
Posted: Mon Jul 13, 2015 3:11 am
by She
i used this
//badge
$("[name=btnTodayAtt]").parent().addClass("ui-badge-container");
$("[name=btnTodayAtt]").before('span class="badge"4/span');
$(".badge").css("display","block");
then the output looks like this, the badge is in the grid. i want the badge will post in the TODAYS Attendance Button Screnshot:
https://d2r1vs3d9006ap.cloudfront.net...
Thank you
How do I add badges to buttons?
Posted: Mon Jul 13, 2015 6:12 am
by Evgene Karachevtsev
Hello She,
I suppose you should use position scc rule to display it where you want. Please look at the first Yurii's reply, I think this is what you need.