How to make so that the icon returned to its original position after 5 seconds?

How to make so that the icon returned to its original position after 5 seconds?

$(".toggle-icon").click(function() {
$('#nav-container').toggleClass("pushed");
});
July 2nd 19 at 14:19
1 answer
July 2nd 19 at 14:21
Solution
$(".toggle-icon").click(function() {
$('#nav-container').addClass("pushed");
 setTimeout(function () {
$('#nav-container').removeClass("pushed");
 }, 5000);
});

or via css animations, depends on whether we need class pushed after 5 seconds

Find more questions by tags JavaScriptHTMLCSS