How to omit opacity changes from jQuery show ()

I want to use jQuery function show(700), but I don't need opacity changes. This element has a PNG background image with alpha transparency, and changing the opacity causes strange black borders around the background image during the animation. How to omit opactiy animation from function show()?

+3
source share
3 answers

Use the animation function and just change the width and height. Here is the plugin that will show.

jQuery.fn.extend( {
    reveal: function() {
       return this.each( function() {
           var $this = $(this);
           $this.animate( { width: "show", height: "show" } );
       });
    }
}
+3
source

. genFx jQuery. , , animate . "" !

...

.animate({ width: "show" });
+1

jQuery show slowly (show with duration) makes glide and fadein at the same time. If all you need is rolling, just use slidedown.

jQuery("#someElement").slideDown(700);

Not much to talk about.

+1
source

Source: https://habr.com/ru/post/1724240/


All Articles