Skip to content

Instantly share code, notes, and snippets.

@tompng
Created March 13, 2013 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tompng/5152585 to your computer and use it in GitHub Desktop.
Save tompng/5152585 to your computer and use it in GitHub Desktop.
fadein,fadeout
function show(html){
var target=$("#targetID");
var old=target.children();
var next=$("<div>");
next.html(html);
next.css({position:'absolute',left:0,top:0,width:'100%',height:'100%',display:'none',background:'white'})
target.append(next)
next.fadeIn(1000,function(){old.remove()})
}
$('a').live('click',function(){
var url=$(this).attr('href');
$.get(url,function(val){
show(val)
})
return false;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment