Skip to content

Instantly share code, notes, and snippets.

@devyfriend
Created June 24, 2013 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devyfriend/5851747 to your computer and use it in GitHub Desktop.
Save devyfriend/5851747 to your computer and use it in GitHub Desktop.
twitter bootstrap modal fluid ... just add .modal-fluid in div with modal id
(function ($) {
$(function () {
function update() {
var width = $(document).width();
var height = $(document).height();
$('.modal-fluid').css({
width: width * 0.8,
marginLeft: -(width * 0.4)
});
$('.modal-fluid .modal-body').css({
maxHeight: (height * 0.8) - 136
});
$('.modal-fluid').each(function () {
$(this).css({
marginTop: -($(this).height() / 2),
});
});
}
$(document).resize(update);
update();
});
}(window.jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment