If you want or have to stick to CSS 3 transitions for performance or other reasons, then you could use window.setTimeout to add a class after the timeout period that sets the display property to none. This should prevent the links from being clickable, remove the hover effects and prevent screen readers from reading the hidden content.
The obvious flaw in this is that the setTimeout period would need to be the same as the period used in your transition, which introduces a maintenance cost.
Update:
Thanks to DoXicK, I have created a JSFiddle which uses the transitionEnd event to add the 'hide' class to the notification box if the standard transition property is available in the browser. It falls back to the setTimeout as described above.
// Notify Box
(function() {
var $notifyBox = $(".notify-box");
var supportsStandardTransition = ($notifyBox[0].style['transition'] !== undefined);
if (supportsStandardTransition) {
$notifyBox.on('transitionEnd', function() {
$(this).addClass('hide');
});
}
$(".notify-icon").on('click', function(){
if ($notifyBox.hasClass('show')) {
$notifyBox.removeClass('show');
if (!supportsStandardTransition) {
window.setTimeout(function () {
$notifyBox.addClass('hide');
}, 150);
}
} else {
$notifyBox.addClass('show').removeClass('hide');
}
});
})();
CSS-
.notify-box {
background: #FFF;
position: absolute;
top: 50px;
left: 0;
opacity: 0;
top: 70px;
-ms-transition: opacity 0.15s ease-in-out;
-moz-transition: opacity 0.15s ease-in-out;
-o-transition: opacity 0.15s ease-in-out;
-webkit-transition: opacity 0.15s ease-in-out;
transition: opacity 0.15s ease-in-out;
width: 200px;
z-index: 9998;
}
.notify-box.show {
opacity: 1;
-ms-transition: none;
-moz-transition: none;
-o-transition: none;
-webkit-transition: none;
transition: none;
}
.notify-box.hide {
display: none;
}
I have also modified the HTML to initially add the 'hide' class to the notify box, added a class definition in the CSS and tweaked the transition styles to be specific to opacity, and removed the transition when the 'show' class is applied - to make the notification box appear 'instantly' (as quickly as the browser can render it) and only transition when hiding. I have also moved the top property to the .notify-box class so it doesn't move as it is being hidden, which looked odd.