JQuery - damps an element in / out while maintaining the layout of the stream

I have a list of items in my web application; each of them has a set of command buttons located under it.

To clear the interface, these buttons are displayed only when you hover over an item. The buttons are wrapped with a tag that has the following CSS attribute: visibility: hidden

This saves the layout so that the list items do not skip when the buttons are opened.

What I want to do is fade in / out buttons using jQuery. However, the default methods ( fadeIn(), fadeOut() ) seem to use display: none , which removes the buttons from the stream.

What I need is a way to fade them out or use them using the visibility attribute. So, before I start the search, does anyone know an obvious way to do this that I am missing?

Greetings

+7
jquery css
source share
3 answers

Create empty DIV wrapper files (with the specified sizes) for the elements you fade out. Guess what's inside. Alternatively, you can withdraw it by 1%, so it will still take its place, but it will be barely noticeable.

+1
source share

Reset your own attenuation, for example:

 $(this).animate({opacity: "0.0"}); 
+15
source share

It seems that $ (this) .fadeTo ("slow", 0); should do this, docs don't say anything about display settings. Only fadeOut () has a mapping: none; set in the docs, but give me a moment and I will check it out.

+3
source share

All Articles