Solved

resize child window to match content

Posted on 2003-10-24
2
394 Views
Last Modified: 2008-03-06
I have a child window which contains dynamic tables, the width of the child is ok but sometimes the table length is greater than the window length and i would rather resize the window to show all the content than require the user to scroll to access the functions in the page.

Thanks
0
Comment
Question by:James Rodgers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
devic earned 100 total points
ID: 9615946
hi Jester_48, here is example, you can change numbers, to correct with your window:
==============================================================
<script>
function runit()
{
      var dynTable=document.getElementById("dynTable");
      window.resizeTo(dynTable.scrollWidth+100,dynTable.scrollHeight+200)
}
</script>
<table id=dynTable width=555 height=300 cellspacing=0 cellpadding=0 border=1>
      <td>&nbsp;</td>
</table>
<button onclick=runit()>runit</button>
0
 
LVL 25

Author Comment

by:James Rodgers
ID: 9616010
thanks...

works great!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question