Because I need to fadeIn() another element of the same size back in, is there a way to fadeOut() the element so that the space is kept, so that the other elements are not re-flowed for a split second and then the fadeIn() will bring back another element with the same size?
jQuery Effect fadeOut() Method The fadeOut() method gradually changes the opacity, for selected elements, from visible to hidden (fading effect). Note: Hidden elements will not be displayed at all (no longer affects the layout of the page). Tip: This method is often used together with the fadeIn() method.
The jQuery fadeIn() method is used to fade in a hidden element. Syntax: $(selector).
jQuery - fadeOut( speed, [callback] ) Method The fadeOut( ) method fades out all matched elements by adjusting their opacity to 0, then setting display to "none" and firing an optional callback after completion.
jQuery has 2 fading methods which are . fadeIn() and . fadeOut(). The fadeIn method displays the element by fading it to opaque. The fadeOut method hides the element by fading it to transparent.
Two techniques come to mind:
my suggestion is you wrap it with div... and put the same dimension on that div...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With