Carl
Posts: 0
Joined: Mon Nov 17, 2014 12:08 am

Css applied in javascript action does not update element on screen

Hi, Im trying to apply a simple style to a button when it is being clicked prior to calling geolocation service. The class is being applied to the button but the view does not update to reflect say a change in background-color. Is there a way I can make sure screen is refreshed prior to calling service? i.e. a refresh() command ?

avf
Posts: 0
Joined: Fri Sep 26, 2014 11:23 am

Css applied in javascript action does not update element on screen

Can you post the code you are using, along with the name of the element?

Ihor Didevych
Posts: 0
Joined: Wed Nov 19, 2014 7:55 pm

Css applied in javascript action does not update element on screen

Hi Carl,

Your style didn't apply if it hasn't changed any button styles.
May be you meant that you found your button with implemented selector, but it didn't guarantee that your selector has 'weight' more then other selectors.

Please, Look at this doc - http://css-tricks.com/specifics-on-cs...
you can start from "Calculating CSS Specificity Value" part

Carl
Posts: 0
Joined: Mon Nov 17, 2014 12:08 am

Css applied in javascript action does not update element on screen

Hi All thanks for responses - I proved out that css was correct and when applied would update button style as expected, but for whatever reason UI lagged when JS called other services. I changed approach and solved issue via alternate approach.

Carl
Posts: 0
Joined: Mon Nov 17, 2014 12:08 am

Css applied in javascript action does not update element on screen

Thanks for follow up avf - all sorted now.

Carl
Posts: 0
Joined: Mon Nov 17, 2014 12:08 am

Css applied in javascript action does not update element on screen

Thanks Ihor - wasnt the issue, but have resolved via different approach.

avf
Posts: 0
Joined: Fri Sep 26, 2014 11:23 am

Css applied in javascript action does not update element on screen

You are welcome! I'm glad you solved it.

Ihor Didevych
Posts: 0
Joined: Wed Nov 19, 2014 7:55 pm

Css applied in javascript action does not update element on screen

Thank you for the update, glad it works!

Return to “Issues”