michaellunsford Posted October 2, 2006 Share Posted October 2, 2006 window.resizeTo(300,200) work great on some browsers, but not on others. The "goal" is to have the window the minimum width and height allowed without presenting scroll-bars.I know what you're thinking, "yeah, turn off the scroll bars" but that is not a solution. IE's toolbar is apparently counted as screen height, so if they have all kinds of google bars, button bars, blah blah, 200 just isn't tall enough to display all the information on the page. If I make it 400, then firefox, safari, camino, pick one will have an extra 200px of white space at the bottom.Is there some way to find out at what point the auto-scroll-bars will disappear? Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted October 2, 2006 Share Posted October 2, 2006 In firefox they only appear if there is somewhere to scroll to. Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted October 2, 2006 Author Share Posted October 2, 2006 Yes, I am aware of when they appear. The problem is I want to make the page as small as possible without them appearing. So, I repeat the question: Is there a way to determine at what point scroll-bars will appear? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 3, 2006 Share Posted October 3, 2006 I'm not sure if .clientHeight or .offsetHeight is the right one, but I believe that one will give you the dimensions you require. Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted October 3, 2006 Author Share Posted October 3, 2006 hmmm... document.clientHeight and document.offsetHeight both return the current window height in safari. Apparently these don't translate to firefox using just "document". However, Firefox (and everything else, for that matter) will tell me how tall a DIV is (although it's calculation is lower than the actual number).For fun, I made a little setInterval loop that measures the size of the DIV and makes the page that size. It would drop the page height by about 100px with each loop. At the end of the day, I had to just hardcode the height in and hope for the best. Quote Link to comment Share on other sites More sharing options...
fenway Posted October 3, 2006 Share Posted October 3, 2006 Yeah, it's an annoying game... you can IE expressions (ugh), and deal with Gecko-browsers separately, or just hard-code it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.