开发者

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"));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜