Can jQuery fadeIn() add a class instead of an inline style? -


when running .fadein() jquery automatically adds display:block inline selector:

$('div').hide().fadein(); 

is possible result this:

<div class="active"></div> 

instead of this:

<div style="display:block"></div> 

i don't want add/remove inline styles. can't remove style attribute because there might styles set not have control over. want add class on fadein() instead of add inline display:block style.

you try adding active class , clearing display style after fadein() completes so:

$('div').hide().fadein(400, function() {     $(this).css('display', '').addclass('active'); }); 

here's quick example: js fiddle


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -