Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,152 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,843 people online right now. Registration is fast and FREE... Join Now!




Dynamically Resize A Browser Window....

2 Pages V  1 2 >  
Reply to this topicStart new topic

Dynamically Resize A Browser Window...., Javascript help

skape999
post 28 Aug, 2002 - 12:41 PM
Post #1


New D.I.C Head

*
Joined: 28 Aug, 2002
Posts: 8

...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. huh.gif
User is offlineProfile CardPM

Go to the top of the page

Cookie Mobster
post 28 Aug, 2002 - 03:44 PM
Post #2


nooneenooneenooonee

Group Icon
Joined: 12 Oct, 2001
Posts: 4,723



Dream Kudos: 18
My Contributions


OK This is about the 6th time this same question has been asked. I'm just going to make it sticky to avoid confusion.
CODE

// resize the current window to the specified width,height
parent.resizeTo(width,height);


Cheers Sam
User is offlineProfile CardPM

Go to the top of the page

skape999
post 29 Aug, 2002 - 05:09 AM
Post #3


New D.I.C Head

*
Joined: 28 Aug, 2002
Posts: 8

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).
User is offlineProfile CardPM

Go to the top of the page

klewlis
post 29 Aug, 2002 - 05:55 AM
Post #4


cur tu me vexas?

*****
Joined: 9 Nov, 2001
Posts: 1,723

could you determine the size of the record on the server side, and then pass those values to the javascript?
User is offlineProfile CardPM

Go to the top of the page

skape999
post 29 Aug, 2002 - 06:12 AM
Post #5


New D.I.C Head

*
Joined: 28 Aug, 2002
Posts: 8

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.
User is offlineProfile CardPM

Go to the top of the page

SlashRaid
post 29 Aug, 2002 - 07:04 AM
Post #6


Dream.In.Force

*****
Joined: 21 Jan, 2002
Posts: 2,421

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?
User is offlineProfile CardPM

Go to the top of the page

klewlis
post 29 Aug, 2002 - 07:26 AM
Post #7


cur tu me vexas?

*****
Joined: 9 Nov, 2001
Posts: 1,723

QUOTE(skape999 @ Aug 29 2002, 09:12 AM)
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!
User is offlineProfile CardPM

Go to the top of the page

skape999
post 29 Aug, 2002 - 07:29 AM
Post #8


New D.I.C Head

*
Joined: 28 Aug, 2002
Posts: 8

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.
User is offlineProfile CardPM

Go to the top of the page

skape999
post 29 Aug, 2002 - 07:32 AM
Post #9


New D.I.C Head

*
Joined: 28 Aug, 2002
Posts: 8

QUOTE(klewlis @ Aug 29 2002, 09:26 AM)
QUOTE(skape999 @ Aug 29 2002, 09:12 AM)
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.
User is offlineProfile CardPM

Go to the top of the page

skyhawk133
post 29 Aug, 2002 - 08:30 AM
Post #10


Head DIC Head

Group Icon
Joined: 17 Mar, 2001
Posts: 14,842



Thanked 45 times

Dream Kudos: 1650

Expert In: Web Development

My Contributions


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.
User is online!Profile CardPM

Go to the top of the page

skape999
post 29 Aug, 2002 - 09:18 AM
Post #11


New D.I.C Head

*
Joined: 28 Aug, 2002
Posts: 8

I'm not sure what PHP is, but I have attached one of the pages I am trying to manipulate....


Attached File(s)
Attached File  soft_track.cfm ( 6.72k ) Number of downloads: 55
User is offlineProfile CardPM

Go to the top of the page

skape999
post 29 Aug, 2002 - 09:29 AM
Post #12


New D.I.C Head

*
Joined: 28 Aug, 2002
Posts: 8

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.


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM

Go to the top of the page

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 01:43PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month