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
Post a Comment