摘要: Bootstrap 的modal正文中如果内容较少的话,并不会垂直居中,而是偏上, 如果想要达到垂直居中的效果,需要自动动手了。可以在初始显示时设置垂直居中,可以这样做:$('#YourModal').modal().css({ 'margin-top': function () { return -($(this).height() / 2); }});或者我们可以将这个效果注册到显示事件中show:This event fires immediately when theshowinstance method is called.$('.modal& 阅读全文
posted @ 2014-03-29 17:32 赤狐(zcm123) 阅读(410) 评论(0) 推荐(0) 编辑