I am using jQuery to slide something down and fade something else out, but in testing it, I've noticed that the fading appears too long after the sliding happens. In other words, there is enough of a lag that it is noticeable.
Just to make myself clear, these two items which I am sliding one and fading the other are different elements and I can not use chaining.
Is there any way to get these functions to run at the same time or closer together so that they appear they are running at the same time ?
Here is the jQuery code that I am using:
$(document).ready(function(){
$('#trigger').click( function(){
$(this).animate({ opacity: 0.0 }); // fade
$('#carousel').animate({ top: '100px' }); // slide
$('#pullrefresh').css('top', '-490px'); // line 5
$('#detector').hide(); // line 6
});
});
The fade and the slide are happening at different times, line 5 and the slide seem to be occurring at the same time.