ScrollTop bootbox modal on fadeIn
问题 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 回答1: I've solved adding .off("shown.bs.modal"); after the bootbox.dialog. bootbox.dialog({ ... }).off("shown.bs.modal"); 回答2: You can set the scrollTop with jQuery in you callback. bootbox.alert("Hello world!", function() { $('body').scrollTop(0); }); 来源: https://stackoverflow.com/questions/27636095