jquery dialog defining maxHeight in percent
jquery, jquery-ui, jquery-ui-dialog
Solution
Try this link to set height in percent.
$(document).ready(function() {
$('#testColorBox').click(function() {
var wWidth = $(window).width();
var dWidth = wWidth * 0.8;
var wHeight = $(window).height();
var dHeight = wHeight * 0.8;
var $link = $(this);
var $dialog = $('<div></div>')
.load('test.html')
.dialog({
autoOpen: false,
modal: true,
title: $link.attr('title'),
overlay: { opacity: 0.1, background: "black" },
width: dWidth,
height: dHeight,
draggable: false,
resizable: false
});
$dialog.dialog('open');
return false;
});
});
Problem
I have created a small project in which I have to display a modal dialog for which I have used jquery-ui dialog. I want to define the max height for the dialog in percent. I have tried several things but none of them are working. Please could someone help me what could be the issue. See http://jsbin.com/otiley/1/edit Many thanks