Hello, I'm encountering an issue with a JavaScript animation slide. The goal is for the slide to animate when the browser refreshes by sliding out to 0px and then sliding back in to -280px after 500ms. However, I am running into trouble getting it to slide back in. It seems there is an error in my code. Below is the snippet:
$("#slideout").animate({right:'0px'}, {queue: false, duration: "slow"}, function () {
timer = setTimeout(function () {
$("#slideout").animate({right:'-280px'}, {queue: false, duration: 500})
}, 500);
});
I have been unable to resolve this issue on my own. Would appreciate any help or suggestions on how to fix the code. Thank you!