Page 1 of 1

Changing button icon

Posted: Fri Jan 11, 2013 1:43 am
by Latchezar Mladenov

I want to change the button icon when I click another button. I tried with event run java script but the function which i used was wrong:

$("#add_button span.ui-icon").addClass("ui-icon-minus").removeClass("ui-icon-plus")

And how to add more button icons. Lock, Unlock for an example?


Changing button icon

Posted: Fri Jan 11, 2013 11:34 am
by Kateryna Grynko

Hello,

You can use following JavaScript code to change the icon:
codeTiggzi("add_button").buttonMarkup({ icon: "minus" });/code
Yes, it's possible. To add custom button icons use CSS or JavaScript.
You can find some information here: https://getsatisfaction.com/tiggzi/to...


Changing button icon

Posted: Sat Jan 12, 2013 4:59 pm
by Latchezar Mladenov

When i use the code in javascript function and run it when startScreen load nothing has happened. And can I make the button icon with javascript code when screen starts?


Changing button icon

Posted: Mon Jan 14, 2013 6:55 am
by Maryna Brodina

Hello! I tried this code

codeTiggzi("add_button").buttonMarkup({ icon: "minus" }); /code

on button click and on Screen load event.

To change button icon you should set any icon in Properties section first
Here is an example http://project.tiggzi.com/mobile-fram...


Changing button icon

Posted: Wed Aug 27, 2014 9:33 am
by EJLD

Hi There, I tried this one above as well as some other stuff but couldn't succeed.
I'd like the button to change its own icon from "start" to "locker" onclick.
May I ask you for advice ?
thk you,
Eric


Changing button icon

Posted: Wed Aug 27, 2014 2:03 pm
by Evgene Karachevtsev

Hello Eric,

Please add this JS code:
preApperyio("buttonName").buttonMarkup({ icon: "lock" });/pre
on the event click of this button (buttonName - its name)


Changing button icon

Posted: Thu Aug 28, 2014 3:15 am
by EJLD

Hi Evgene, it works as expected.
just to know, would you guys have a list of all icons' respective names ?
it would very much useful for many of us.
thks
Eric


Changing button icon

Posted: Thu Aug 28, 2014 4:55 am
by obullei

Hello!

Thank you for your update.
You can get more detailed information about this option in JQM documentation.
Please take a look here:
http://api.jquerymobile.com/buttonMar...


Changing button icon

Posted: Thu Aug 28, 2014 1:12 pm
by EJLD

perfect! thks for forwarding me that page. I'll keep that site in mind.