Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap and bootbox: dynamically change the width of confirmation window

I am using Bootstrap for a web application and using bootbox (http://bootboxjs.com) for showing a window before proceeding with a delete operation.

For different delete options, I need to display different messages. I would like to show confirmation windows with different widths.

How can I do this dynamically in javascript code? I looked at everything and am unable to find a solution.

Thanks for any ideas and suggestions!

Cheers.

like image 942
curious1 Avatar asked Jul 01 '13 22:07

curious1


1 Answers

None of the answers above worked for me so I fiddled around until the following did what I expected (using Bootbox.js v4.2.0)

Javascript:

bootbox.alert("Hello").find("div.modal-dialog").addClass("largeWidth");

CSS:

.largeWidth {
    margin: 0 auto;
    width: 90%;
}
like image 165
SirDorius Avatar answered Sep 17 '22 14:09

SirDorius