Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //pre carregando o gif
- $('a').live('click', function( e ){
- e.preventDefault();
- content.html( '<div class="loader"></div>' );
- var href = $( this ).attr('href');
- $.ajax({
- url: href,
- success: function( response ){
- //forçando o parser
- var data = $( '<div>'+response+'</div>' ).find('#content').html();
- //apenas atrasando a troca, para mostrarmos o loading
- window.setTimeout( function(){
- content.fadeOut('slow', function(){
- content.html( data ).fadeIn();
- });
- }, 500 );
- }
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement