Bootstrap / Bootbox: Veränderung modal Breite nur für bestimmte modal
Ich bin mit Bootbox 4 mit Bootstrap 3 auf der IE (IE 8 /IE 9) und alles funktioniert wie vorgesehen.
Sieht es aus wie in Bootstrap 3 Sie können die modal-width in CSS wie folgt, aber so etwas wäre dann ändern alle meine modals:
.modal-dialog {
width:70% !important;
}
Gibt es eine Möglichkeit in CSS, jQuery oder die Bootbox Einstellungen, ich kann ändern der Breite eines Bootbox alert modal nur für eine bestimmte modale ?
Die Bootbox Seite nur eine sehr kurze Dokumentation, und ich konnte nicht finden Informationen auf dieser überall sonst.
Update - JS erstellt, die die spezifischen modal (mit Beispieldaten):
bootbox.dialog({
message: " \
<table class='table table-hover'> \
<thead> \
<tr> \
<th>Item Name</th> \
<th>Location</th> \
<th>Path</th> \
<th>Last Update</th> \
</tr> \
</thead> \
<tbody> \
<tr> \
<td>Item 1</td> \
<td>Navbar - Level 2</td> \
<td>Products - blabla</td> \
<td>Added by xxx on 05 Aug 2014</td> \
</tr> \
</tbody> \
</table>",
title: "Search Results",
buttons: {
main: {
label: "Close",
className: "btn-primary"
}
},
className: "modal70"
});
Und mein Aktuelles CSS:
.modal-dialog.modal70 {
width:70% !important;
}
Vielen Dank für jede Hilfe mit diesem, Tim.
Du musst angemeldet sein, um einen Kommentar abzugeben.
Versuchen Sie dies:
Update:
Versuchen Sie Demo -
Nur als weiterführende Informationen...
Wie die Dokumentation sagt, Sie können Steuern, die Größe des modal mit der "size" - Eigenschaft im Konstruktor.
Siehe Snippet zum Anwendungsbeispiel (am besten im Vollbildmodus)
JS:
CSS:
HTML:
Mehr info, Quelle: http://bootboxjs.com/documentation.html
Wenn die Lösung von Moshtaf nicht funktioniert, füllen Sie es mit einer weiteren Zeile:
Dies ist, weil Bootbox umfasst auch einen default-Wert für max-width kann, überschreibt die definition für die Breite.