• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problem in window resizing on Loading

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to control the window size of my html or jsp page whenever first time the page is loaded. For example, I want to control window size for the page 'test.html' to 400(width) x 600(height). Please refer to the following my code. Please help me out where I did mistake.
Thanks adn regards,
Smitha
=================================================================
<html>
<head>
<script>
function setWindowSize() {
document.body.offsetWidth = "400";
document.body.offsetHeight = "600";
}
</script>
</head>
<body onLoad="setWindowSize()">
<form>
<b>This is the testing page for window sizing</b>
</form>
</body>
</html>
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this instead
place in the head tag
<script>
self.moveTo(0,0);
self.resizeTo('400','600');
</script>
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"smitha_rai",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in again with a new name which meets the requirements.
Thanks.
Dave
 
smitha rai
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Following is worked perfect. How fo I disable, the menubar and toolbar from the pop up window?
<script>
self.moveTo(0,0);
self.resizeTo('400','600');
</script>
Smitha
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Goto this page, it will do the work for you
http://www.a1ien51.8k.com/scripts/popupwingenV2.htm
 
    Bookmark Topic Watch Topic
  • New Topic