I use bootbox.js to make modal but when the modal fadeIn and the content is too long, the scrollbar goes at the level of the bottom button. I need the scrollbar stay on top when modal appear
I use bootbox.js to make modal but when the modal fadeIn and the content is too long, the scrollbar goes at the level of the bottom button. I need the scrollbar stay on top when modal appear
Share Improve this question edited Jun 30, 2015 at 12:31 Siguza 24k6 gold badges55 silver badges99 bronze badges asked Dec 24, 2014 at 11:20 Thomas MairéThomas Mairé 5544 silver badges16 bronze badges 2- Show your code for showing bootbox. – Manwal Commented Dec 24, 2014 at 11:26
-
var bootboxAffiche = function(p_titre, p_contenu){ bootbox.dialog({ title : p_titre, message : p_contenu, buttons:{ success: { label : 'Fermer', className: "btn-primary" } } }); }
– Thomas Mairé Commented Dec 24, 2014 at 13:08
2 Answers
Reset to default 6I've solved adding .off("shown.bs.modal");
after the bootbox.dialog.
bootbox.dialog({ ... }).off("shown.bs.modal");
You can set the scrollTop with jQuery in you callback.
bootbox.alert("Hello world!", function() {
$('body').scrollTop(0);
});