Quando eu vou pra alguma página do site e tento executar o script funcional, ele só funciona quando eu dou f5, ou seja, ele não funciona com o .load em uma div.
JS
$(document).ready(function(){
var content = $('#content');
$('a').live('click', function( e ){
e.preventDefault();
$("html, body").animate({
scrollTop: $("#content").offset().top
}, 300);
content.html( '<div class="loading"></div>' );
var href = $( this ).attr('href');
$.ajax({
url: href,
success: function( response ){
var response = $( '<div>'+response+'</div>' );
var data = response.find('#content').html();
window.setTimeout( function(){
content.fadeOut('slow', function(){
content.html(data).fadeIn();
var title = response.find('title').text();
window.history.pushState( href, title, href );
document.title = title;
});
}, 500 );
}
});
});
});
PARTE DO HTML
//head, meta, links do js e css
<body>
//conteudo
<div id="content">
//conteudo carregado
</div>
</body>
$("#content")
e tem<div class="content">
. Não seria$(".content")
ou então<div id="content">
#content
?