This is the code they use.
$("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6 $("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); }
so you can use it with minor changes (assuming you are using a modern version of jQuery).
$('#yourbutton').click(function() { var TB_WIDTH = 100, TB_HEIGHT = 100; // set the new width and height dimensions here.. $("#TB_window").animate({ marginLeft: '-' + parseInt((TB_WIDTH / 2), 10) + 'px', width: TB_WIDTH + 'px', height: TB_HEIGHT + 'px', marginTop: '-' + parseInt((TB_HEIGHT / 2), 10) + 'px' }); });
Demo at http://jsfiddle.net/gaby/rrH8q/
source share