怎樣讓模態(tài)框居中呢?現(xiàn)在只能設(shè)置居上居下,但不能垂直居中,可以做到垂直居中嗎???

蚊子漫布
2014-10-31
1 回答
舉報
0/150
提交
取消
怎樣讓模態(tài)框居中呢?現(xiàn)在只能設(shè)置居上居下,但不能垂直居中,可以做到垂直居中嗎???
2014-10-31
舉報
2014-10-31
可以在bootstrap.js文件900行后面添加如下代碼,便可以實現(xiàn)垂直居中。
that.$element.children().eq(0).css("position", "absolute").css({
????????? "margin":"0px",
????????? "top": function () {
????????????? return (that.$element.height() - that.$element.children().eq(0).height()-40) / 2 + "px";
????????? },
????????? "left": function () {
????????????? return (that.$element.width() - that.$element.children().eq(0).width()) / 2 + "px";
????????? }
????? });