我有一个简单的问题,当高度大于div
时,我可以隐藏1000px
吗?
如果div
小于此高度,我们可以看到其中的内容。
答案 0 :(得分:0)
Take a look at this example: http://codepen.io/anon/pen/XbmbVL
You have 2 divs, a tall one and a small one. Inside JS you have a global variable, named maxHeight.
On document ready, I hide all the data-hide-based-height
div with a height that is over than maxHeight.
PS if you try to change maxHeight, for example to 150, you should see both the divs