NG-展示令人不安的DIV布局 - angularJS [英] ng-show disturbing div layout - angularJS

查看:107
本文介绍了NG-展示令人不安的DIV布局 - angularJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 NG-秀=!notesOpened来隐藏一个div如果notesOpened变量为真。但时隐时它搅乱了布局。有没有一种方法,使NG-秀行为以同样的方式为CSS属性 visibility:hidden的?使周围所有的div div元素被隐藏在同一个地方停留

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

推荐答案

NG-隐藏使用,你指的是同一个属性,即显示:无

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;

对于您可以使用纳克级属性。

例如:纳克级={'相隐:notesOpened ==真}

  .vis-hidden{
     visibility: hidden;
  }

这篇关于NG-展示令人不安的DIV布局 - angularJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆