I want to put up an overlay on my screen while some ajax stuff is running. Building my own overlay div isn\'t a big deal, but, since I\'m already using Bootstrap, I figure
Just append a div
with that class to body
, then remove it when you're done:
// Show the backdrop
$('').appendTo(document.body);
// Remove it (later)
$(".modal-backdrop").remove();
Live Example:
$("input").click(function() {
var bd = $('');
bd.appendTo(document.body);
setTimeout(function() {
bd.remove();
}, 2000);
});
Click the button to get the backdrop for two seconds.