J
Joe
Is there a way to enable scrolling in a modal dialog box even if the
call to open the modal has "scroll:no"? I am looking to dynamically
size the modal dialog box for starters and if the modal is greater
than 400px in height, I want turn on the scroll bars otherwise I don't
want to turn them off.
CODE IN MY PARENT WINDOW.....
function modal()
{
window.showModalDialog("modal.htm", "docForm",
"center:yes;resizable:no;scroll:no;status:no;");
}
CODE IN THE MODAL DIALOG TO AUTO RESIZE AND TURN ON SCROLL BARS IF
NEEDED....
<script language="JavaScript">
function AutoSizeModal()
{
var w = document.getElementById('Content').scrollWidth;
var h = document.getElementById('Content').scrollHeight;
if(h > 400)
{
var h = 400;
//Enable scrollbars here
}
var width = eval(w + 10);
var height = eval(h + 28);
window.dialogWidth = width+"px";
window.dialogHeight = height+"px";
}
</script>
</head>
<body onLoad="AutoSizeModal()">
<table width="300" border="0" id="Content">
<tr>
<td>
test
</td>
</tr>
</table>
</body>
</html>
call to open the modal has "scroll:no"? I am looking to dynamically
size the modal dialog box for starters and if the modal is greater
than 400px in height, I want turn on the scroll bars otherwise I don't
want to turn them off.
CODE IN MY PARENT WINDOW.....
function modal()
{
window.showModalDialog("modal.htm", "docForm",
"center:yes;resizable:no;scroll:no;status:no;");
}
CODE IN THE MODAL DIALOG TO AUTO RESIZE AND TURN ON SCROLL BARS IF
NEEDED....
<script language="JavaScript">
function AutoSizeModal()
{
var w = document.getElementById('Content').scrollWidth;
var h = document.getElementById('Content').scrollHeight;
if(h > 400)
{
var h = 400;
//Enable scrollbars here
}
var width = eval(w + 10);
var height = eval(h + 28);
window.dialogWidth = width+"px";
window.dialogHeight = height+"px";
}
</script>
</head>
<body onLoad="AutoSizeModal()">
<table width="300" border="0" id="Content">
<tr>
<td>
test
</td>
</tr>
</table>
</body>
</html>