Page 1 of 1
Css applied in javascript action does not update element on screen
Posted: Wed Nov 26, 2014 10:19 am
by Carl
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 ?
Css applied in javascript action does not update element on screen
Posted: Wed Nov 26, 2014 10:56 am
by avf
Can you post the code you are using, along with the name of the element?
Css applied in javascript action does not update element on screen
Posted: Wed Nov 26, 2014 1:03 pm
by Ihor Didevych
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
Css applied in javascript action does not update element on screen
Posted: Wed Nov 26, 2014 9:16 pm
by Carl
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.
Css applied in javascript action does not update element on screen
Posted: Wed Nov 26, 2014 9:17 pm
by Carl
Thanks for follow up avf - all sorted now.
Css applied in javascript action does not update element on screen
Posted: Wed Nov 26, 2014 9:17 pm
by Carl
Thanks Ihor - wasnt the issue, but have resolved via different approach.
Css applied in javascript action does not update element on screen
Posted: Wed Nov 26, 2014 9:20 pm
by avf
You are welcome! I'm glad you solved it.
Css applied in javascript action does not update element on screen
Posted: Wed Nov 26, 2014 9:42 pm
by Ihor Didevych
Thank you for the update, glad it works!