Hi,
When I want to change the content of an element, it works fine without effects, and does this behaviour with the effects:
- changes the content to the new one
- does the hiding effect, on the new content
- does the showing effect, still on the new content
Here is the code that is launched everytime I need to change the content:
function changePage(slug) {
var content = $('#content');
var title = $('#name');
$.getJSON('http://'+location.host+'/'+slug+'.json', function(data) {
$('#main').fadeOut('slow');
title.html(data.name);
content.html(data.content);
$('#main').fadeIn('slow');
});
}
Here is the code that runs this function:
var app = new Sammy.Application(function() {with(this){
get('#/', function() { with(this) {
changePage('_home');
}});
get('#/:page', function() { with(this) {
changePage(params['page']);
}});
}});
$(function(){app.run();});
It's sammy, http://github.com/quirkey/sammy/ .
Thank you by advance for your help !