I would like to have a button on my page that scrolls to top of the page and then slides down a div.
this is what I have:
$(document).ready(function(){
$(".slidingDiv").hide();
$(".show_hide").show();
$('.show_hide').click(function(){
$("html, body").animate({ scrollTop: 0 }, 1000);
$(".slidingDiv").slideToggle(500);
});
});
the problem is that when the animate scrolltop ends the div have already slided, how can I chain the actions?
thanks