I am using ng-show="!notesOpened"
to hide a div if the notesOpened variable is true. However when hidden it messes up layout. Is there a way to make ng-show act in the same way as the css property visibility:hidden
? so that all div elements around the div being hidden stay in the same place
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
ng-hide
uses the same property that you're referring to, i.e.display: none
.If you need to achieve this, you need to use
visibility: hidden;
For that you can use the
ng-class
attribute.eg:
ng-class="{'vis-hidden': notesOpened==true}"
You should try
ng-class
instead so you can give the div a class which only dodisplay:none
I have got this working