1

Just a simple question: I have a notification message that can be visible or invisible in a webpage (with jQuery show() or hide()), always in the same place. The problem I am facing is when it appears, it drags down all the contents below it, just it height.

How can I smartly deal with this situation to leave a (blank or not) area so the UI does not change its height when this component disappears/appears?

Scath
  • 3,777
  • 10
  • 29
  • 40
andcl
  • 3,342
  • 7
  • 33
  • 61

2 Answers2

5

Instead of using show() and hide(), you can just add css property opacity:0 and opacity:1 with jquery. This would leave a blank space even the element is not shown.

Aryan Twanju
  • 2,464
  • 1
  • 9
  • 12
0

You can use css property visibility: hidden; and visibility: visible;. This would leave a blank space and UI does not change its height.

Girisha C
  • 1,922
  • 1
  • 12
  • 20