After clicking on menu item data is loaded to "#content". I want to use function makeGray() that turns pictures with class "galleryList" to grayscale and saturating them after pointing with mouse. Unfortunately, code below doesn't work until second click:
$(document).delegate(element, 'click', function() {
$('#content')
.stop()
.animate({opacity: 0}, 'fast', function() {
$(this).load('subpage.html', function() {
makeGray('.galleryList');
})
.animate({opacity: 1});
});
});
Edit after Kevin and Daniel posts: There is code of script making pictures gray. The problem is how to wait until images are fully loaded and then run script.