If you want to display a message with fading opacity, you can create an empty div with 0 opacity:
<div id="messageBox"></div>
Then, using JavaScript, you can easily change the opacity of the message box:
bootbox.alert(message, function() {
document.getElementById('messageBox').innerHTML = message; document.getElementById('messageBox').style.opacity= '1'; setTimeout(function(){ document.getElementById('messageBox').style.opacity = '0'; }, 2000); });
You are free to customize the message box by adding styles such as position, colors, or transitions:
#messageBox { color: #CC0000; font-weight: bold; text-align: center; transition: all 1s linear; -webkit-transition: all 1s linear; }