¿Hay alguna diferencia entre fadeIn() y show() en función de su rendimiento?

I would like to know is there any difference in performance between fadeIn y show.
People keep suggesting me to use show más bien que fadeIn.I researched through lot of websites but all turned out to be diplomatic answers. Looking for more specific and performance oriented solution.

preguntado el 13 de septiembre de 13 a las 10:09

There is a performance difference, but there are many factors to it that you can't just calculate the difference, different browsers will have different performance stats, most modern computers and browsers won't notice much difference, but people on old laptops or lower performing systems will notice more lag using fadeIn especially when using older browsers (like IE8 or below kind of age) -

Fadein is a method which animates opacity so performance is lesser compared to show().. U can even time the show funtion refer API for more info.. api.jquery.com/fadeIn -

Performance? What that means here? A animation will always take more resource than changing a simple CSS rule. But show() can be used to animate too, so... -

Incluso con fadeIn(0), the performance is noticeably worse than show() -

1 Respuestas

show simplemente cambia el display propiedad a block(it can be other values depends on the previous value).

fadeIn increases the opacity value every couple of milliseconds until the value 1.0 which is obviously a lot more expensive,

Regarding to the which is better, none is better! They do two different things!
If you simply need to show something hidden use show.
If you need to animate something hidden to fade in use fadeIn

Respondido el 13 de Septiembre de 13 a las 10:09

@A.Wolff, that's true, they added an overload with a duration parameter, I have no idea why they did that. - gdoron está apoyando a Monica

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.