Customizing bootbox

Viewed 3501

I'm trying to customize bootbox design. I have succeeded in getting the output which shows like below: enter image description here

here my code is

        var dialog = bootbox.alert({
    closeButton: false,
         title: false,
         message: 'hello',
         className: "my-popup"
      });
      dialog.init(function(){
var message = $(".my-popup").find(".bootbox-body");
$(".my-popup").find(".modal-footer").prepend(message);
$(".my-popup").find(".modal-footer div").css({"display":"inline-block", "padding-right":"10px", "color":"#f7f7f7"});
 $(".my-popup").find(".modal-body").remove();    
});

this works well. but I have few more alerts on my page which I also want to show like this. so I tried to minified above code or to set common properties for bootbox but after that my init function stop working.

here is the fiddle. I'm using bootbox.setDefaults to set a common class and then trying to give alert but init not working now. Is there a way through I can set init function after bootbox.setDefaults so i just simply call bootbox.alert() only every time. not the whole code.

2 Answers
Related