How can I shorten and optimize this code which displays then hides a DIV
?
setTimeout(function () {
$('.updateNotification').show().addClass('heightener');
callback();
},2000)
function callback() {
setTimeout(function() {
$( '.updateNotification' ).fadeOut();
}, 10000 );
};
My first thought was to combine the functions. However, I would like them to remain separate because at a later date I will additionally incorporate a button which will trigger callback()
in addition to the timer.