jquery element cross fade plugin
I'm looking for a plugin that, ideally, just fades one element into a开发者_如何学Gonother. Not just images.
It seems that every plugin out there is a) image specific or b) a full-on, bloated, slideshow plugin.
Is there anything that just takes two arguments, and fades one into the other?
Thanks!
You can write an utility method like this
$.fadeReplace = function($from, $to){
$from.fadeOut(500, function(){
$(this).replaceWith($to);
$to.fadeIn(500);
});
}
Usage
$.fadeReplace($("#div1"), $("#div2"));
精彩评论