Click to See Complete Forum and Search --> : resize window to only needed dimensions


drewbie49
02-24-2003, 07:00 PM
i have a popup with a dropdown and sometimes the pre-defined window dimensions will be too small. i need javascript to enlarge the dimensions until no scrolling is needed. thanks for any help!

drewbie49
02-26-2003, 06:30 PM
hi, thanks for the reply, but the window isnt doing anything. maybe its my syntax?thanks for your help.

function checkwin() {
var MyWidth = 0;
if( document.body.clientWidth < document.body.scrollWidth ) {
MyWidth = document.body.scrollWidth;
document.resizeTo(MyWidth,500);
}

and im calling it like this...

<body onLoad="checkwin()" bgcolor="white">

drewbie49
02-26-2003, 07:16 PM
nope, that didnt work either, but i found something odd...when i add the checkwin function to the header, then my checker() function doesnt work. why is this? here's my code-

<script type="text/javascript">
<!--
function launch (url,w,h) {
self.name = "opener";
remote = open(url, "remote", 'width='+w+',height='+h+',scrollbars');
}
function launch2 (url) {
self.name = "opener";
remote = open(url, "remote", 'width=360,height=190');
}
function checker() {
return confirm("Are you sure you want to delete this record?");
}
function checkwin() {
var MyWidth = 0;
if( document.body.clientWidth < document.body.scrollWidth ) {
MyWidth = document.body.scrollWidth;
window.resizeTo(MyWidth,500);
}
// -->
</script>

</head>
<body onload="checkwin()">

drewbie49
02-26-2003, 07:28 PM
lol, forgot to close my function :) thanks for the help dave