Whenever I click "About Me" multiple times, the jQuery animation stops as expected. However, if I click "My Portfolio", "Web", "Graphic", and "Others" more than once, the #box1 div keeps moving down endlessly. This might not be noticeable at first, but once you click "About Me" again, the issue becomes apparent.
Is there a way to prevent this from occurring?
If you need to see the code in action, check out this JSFiddle link: https://jsfiddle.net/yg4717a8/1/
Thank you all in advance for your help :)
$(document).ready(function () {
var hasSlid = false;
$('a#hide').click(function () {
$('#box1').animate({
'top': '+=155px',
easing: 'easeInOutCubic',
opacity: 0
}, 500,
function () {
$('#box1').hide();
});
$('#container').show();
hasSlid = false;
});
});