blinking in two elements with ng-show and opposite expressions

时间:2016-09-01 06:28:13

标签: javascript angularjs

I have two elements that only one of them needs to be visible. They're display is controlled via the ng-show directive, and their expression is opposite, namely one has ng-show="shouldshow" and the other has ng-show="!shouldshow".

It works as expected but with a small side effect, when the shouldshow changes there's a short period that both elements are displayed or both elements are not displayed. As these two elements are shown side by side with other elements around them this messes up the page layout during that blink.

This behavior is visible with some browsers, not all.

Ideas?

0 个答案:

没有答案