JQuery Effects slide unexpected delay-Collection of common programming errors
The following code determines what the link target was sidebar or page and from that slides panels accordingly. The sidepanel ones work unison with the the visible sidepanel sliding out left sycronising with one sliding in from the right.
The page ones however ‘main’ do not. The left one slides out and the new plane slides in after a delay of around 300ms. This should not happen as the code is the same. Any ideas.
var panel = $('.sidewrapper:visible');
var panelnext = $('.sidewrapper:visible').next();
var paneltarget = $('.sidewrapper:visible').next().find('.sidescroller').children();
var page = $('.mainwrapper:visible');
var pagenext = $('.mainwrapper:visible').next();
var pagefirst = $('.mainwrapper:visible').first();
var pagetarget = $('.mainwrapper:visible').next().find('.mainscroller').children();
if (target == 'sidebar') {
$(paneltarget).html(data.sidepanel);
$(panel).hide('slide', { direction: 'left' }, 300); $(panelnext).show('slide', { direction: 'right' }, 300);
}
else if (target == 'page') {
$(pagefirst).find('.mainscroller').children().html(data.sidepanel);
$(page).hide('slide', { direction: 'left' }, 300); $(pagefirst).show('slide', { direction: 'right' }, 300);
}
Any ideas,
Marvellous