i'm trying to load with a fade in an html with ajax. It loads but with no fade, I don't know what i'm doing wrong, here it's my code:
$("#artworks").click(function(){
// load artworks page
$("#content").load("artworks.html"); function(){
$(this).fadeIn("slow");
});
});
it get's an error, what's my mistake?
$("#artworks").click(function(){
$("#content").load("artworks.html"); function(){
$(this).fadeIn("slow");
});
});
SHOULD BE
$("#artworks").click(function(){
$("#content").load("artworks.html", function(){
$(this).fadeIn("slow");
});
});
NOTE THE CHANGE OF ;
TO ,
AND THE MOVEMENT OF THE )
Perhaps you mean:
$("#artworks").click(function(){
// load artworks page
$("#content").load("artworks.html", function(){
$(this).fadeIn("slow");
});
});
This will only work if #content
is invisible before the AJAX-load.