fadein - Add fade-in or fade-out on the addclass / removeclass event -



fadein - Add fade-in or fade-out on the addclass / removeclass event -

i beginner, please don't rough me.

i created addclass , removeclass event :

$(".myclass").click(function(){ $(".hiding").removeclass("hiding"); $(this).addclass("hiding"); });

this css :

#wrapper a.hiding { display: none; }

and html :

<div id="wrapper"> <a class="myclass" href="#2"> <img src=""> </a> </div>

so moment, works fine, add together fade-in action when addclass, , fade-out when removeclass tried css using

-webkit-transition: 0.5s ease;

but it's not working.

i recommend seek this

edit: realized using fadein() better, seek this:

$(".myclass").click(function(){ $(".hiding").fadeout('slow', function() { $(".hiding").removeclass("oldstuffhere"); $(this).addclass("newstuffhere"); $(this).fadein('slow', function() { // animation finish }); }); });

fadein fadeout addclass removeclass

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -