Join 109,296 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,221 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!
...Is it possible with Javascript? I have a Coldfusion template page which has on it three buttons that link to three more seperate Coldfusion template pages calling its content from a database. Since the content in these pages varies, my aim is to have the window resize itself to fit the content appropriately and negate having to use the scroll bars. Any help with this will be greatly appreciated.
My problem is that I can't specify the width and height, I need that to be determined by the volume of the content. There are close to one hundred different records of varying size that the user can select. I want to know if Javascript has the capability to look at the record called and adjust the browser size accordingly (dynamically).
I could do that, but it would be a painstaking process, that is why I am looking for a script that can recognize the dimensions and handle the resizing on its own. I'm not even sure its possible due to my inexperience with scripting, hence my journey to dreamincode.net.
In theory, wouldn't then be possible to have a large amount of content that would cause the window to be sized out side of the viewable screen width and length?
To me, I would thing you'd want to size the content with a standard size window that you know the user will be able to view.
What type of content is it? Images? What sizes do you anticipate?
I could do that, but it would be a painstaking process, that is why I am looking for a script that can recognize the dimensions and handle the resizing on its own. I'm not even sure its possible due to my inexperience with scripting, hence my journey to dreamincode.net.
personally, I'd pick server-side over javascript wherever possible. It's not painstaking at all (unless you aren't familiar with the server-side language). And also, then you could format the info in any way you desire. Then just pass the values back into the javascript for the window resize, and you're all set!
SlashRaid, In theory, yes, but my content varys from one line up to approximately twenty, with a fixed width. So unless someone is using a screen the size of their cell phone's to view my site it wouldn't be a problem. The content is just text, with some of it linked. If it were my call this wouldn't be an issue, but becuase I work with govt. employees that feel the need to flex their power to the fullest I constantly have to jump through hoops. Case in point, I could make the browser one uniform size that would fit everything nicely, but for the instances where there is less than the maximum amount of content my client doesn't want to see any blank space and in fact requested specifically what I am asking help for. Frustration is a feeling I have grown very familiar with.
I could do that, but it would be a painstaking process, that is why I am looking for a script that can recognize the dimensions and handle the resizing on its own. I'm not even sure its possible due to my inexperience with scripting, hence my journey to dreamincode.net.
personally, I'd pick server-side over javascript wherever possible. It's not painstaking at all (unless you aren't familiar with the server-side language). And also, then you could format the info in any way you desire. Then just pass the values back into the javascript for the window resize, and you're all set!
Therein lies the problem, I am not familiar with server-side language, not to mention my limited experience with javascript.
Well, using a little serverside and a little javascript, I can picture someone counting the words or counting the <br>'s or <p>'s or whatever and based on that multiplying $x pixels by $y lines/words/whatever to figure out aprox how big the window should be.
Does the server you are running this on have access to PHP and if you give me an example of one of the pages so I can see the code or how you are displaying it I could better suggest a solution.
Also, here are two examples of the windows I'm talking about and the disparity between the volume of content and the size of the window. I'm going to have to put the second example into another reply.