pboloz
Posts: 0
Joined: Wed Apr 02, 2014 11:38 pm

How to 'unclick' a button

When I click this 'refresh map' button it changes colour to blue and stays like that until I go to other screen. How can I change the settings so that this button changes colour only when clicked and then automatically goes back to it's normal colour?

Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to 'unclick' a button

Hi Pbolos.

Please use this code:

pre
code

//Where "yourButtonName" is - "Refresh Map" button name.
Apperyio("yourButtonName").removeClass("ui-btn-active");

/code
/pre

Note to find "Refresh Map" button name please:

1 Activate this button in the page design mode by clicking on.

2 Copy it in "name" attribute in button properties.

See details: http://prntscr.com/3j0hw9/direct

Regards.

pboloz
Posts: 0
Joined: Wed Apr 02, 2014 11:38 pm

How to 'unclick' a button

I am not sure where do I copy the code you gave me?

pboloz
Posts: 0
Joined: Wed Apr 02, 2014 11:38 pm

How to 'unclick' a button

Do I need to create new JS and copy it there?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to 'unclick' a button

Pbolos,

You should use this code in the JS event handler on event you need.

For example if need to delete selection on any footer button click you should to do:

1 Activate your mobileFooter. http://prntscr.com/3j1ppx/direct

2 Open Events bottom panel and set JS event handler for "click" event. http://prntscr.com/3j1q7s/direct

3 Populate it with following code:

precode

var navBar = this;

var onDelay = function(){
jQuery(navBar).find(".ui-btn-active").removeClass("ui-btn-active");
};
window.setTimeout(onDelay, 500);

/code/pre

This will delete selection after 0.5sec after clicked on.

Regards.

pboloz
Posts: 0
Joined: Wed Apr 02, 2014 11:38 pm

How to 'unclick' a button

I have done as you said Yurii, but it did not work.

Image

pboloz
Posts: 0
Joined: Wed Apr 02, 2014 11:38 pm

How to 'unclick' a button

Can you spot what am I doing wrong Yurii?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to 'unclick' a button

Pbolos,

Perhaps you've selected as component name "button" ? You should to select all footer.

http://prntscr.com/3j1x2g/direct

See again second step:

precode

2 Open Events bottom panel and set JS event handler for "click" event. http://prntscr.com/3j1q7s/direct

/code/pre

Regards.

pboloz
Posts: 0
Joined: Wed Apr 02, 2014 11:38 pm

How to 'unclick' a button

Yes. I have selected a button instead of a navbar. It works now. Thank you.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to 'unclick' a button

Pboloz,

Thanks for update.

Regards.

Return to “Issues”