Latchezar Mladenov
Posts: 0
Joined: Thu Jan 10, 2013 11:19 pm

Changing button icon

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?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Changing button icon

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...

Latchezar Mladenov
Posts: 0
Joined: Thu Jan 10, 2013 11:19 pm

Changing button icon

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?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Changing button icon

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...

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Changing button icon

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Changing button icon

Hello Eric,

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

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Changing button icon

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

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

Changing button icon

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...

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Changing button icon

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

Return to “Issues”