Dynamically Resize A Browser Window....

Javascript help

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 68952 Views - Last Post: 10 March 2009 - 06:49 PM

#1 skape999  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 28-August 02

Dynamically Resize A Browser Window....

Posted 28 August 2002 - 01:41 PM

...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:

Is This A Good Question/Topic? 1
  • +

Replies To: Dynamically Resize A Browser Window....

#2 Cookie Mobster  Icon User is offline

  • nooneenooneenooonee
  • member icon

Reputation: 7
  • View blog
  • Posts: 4,730
  • Joined: 12-October 01

Re: Dynamically Resize A Browser Window....

Posted 28 August 2002 - 04:44 PM

OK This is about the 6th time this same question has been asked. I'm just going to make it sticky to avoid confusion.
// resize the current window to the specified width,height
parent.resizeTo(width,height);



Cheers Sam
Was This Post Helpful? 1
  • +
  • -

#3 skape999  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 28-August 02

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 06:09 AM

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).
Was This Post Helpful? 0
  • +
  • -

#4 klewlis  Icon User is offline

  • cur tu me vexas?

Reputation: 8
  • View blog
  • Posts: 1,723
  • Joined: 09-November 01

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 06:55 AM

could you determine the size of the record on the server side, and then pass those values to the javascript?
Was This Post Helpful? 0
  • +
  • -

#5 skape999  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 28-August 02

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 07: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.
Was This Post Helpful? 0
  • +
  • -

#6 SlashRaid  Icon User is offline

  • Dream.In.Force

Reputation: 1
  • View blog
  • Posts: 2,421
  • Joined: 21-January 02

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 08:04 AM

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?
Was This Post Helpful? 0
  • +
  • -

#7 klewlis  Icon User is offline

  • cur tu me vexas?

Reputation: 8
  • View blog
  • Posts: 1,723
  • Joined: 09-November 01

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 08:26 AM

skape999, on Aug 29 2002, 09:12 AM, said:

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!
Was This Post Helpful? 0
  • +
  • -

#8 skape999  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 28-August 02

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 08:29 AM

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.
Was This Post Helpful? 0
  • +
  • -

#9 skape999  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 28-August 02

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 08:32 AM

klewlis, on Aug 29 2002, 09:26 AM, said:

skape999, on Aug 29 2002, 09:12 AM, said:

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.
Was This Post Helpful? 0
  • +
  • -

#10 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1868
  • View blog
  • Posts: 20,280
  • Joined: 17-March 01

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 09:30 AM

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.
Was This Post Helpful? 0
  • +
  • -

#11 skape999  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 28-August 02

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 10:18 AM

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

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#12 skape999  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 28-August 02

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 10:29 AM

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 image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#13 skape999  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 28-August 02

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 10:30 AM

Here's the second example....

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#14 klewlis  Icon User is offline

  • cur tu me vexas?

Reputation: 8
  • View blog
  • Posts: 1,723
  • Joined: 09-November 01

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 05:14 PM

tell them to suck it up and deal with white space. :)
Was This Post Helpful? 0
  • +
  • -

#15 supernova333  Icon User is offline

  • D.I.C Addict

Reputation: 4
  • View blog
  • Posts: 590
  • Joined: 12-March 02

Re: Dynamically Resize A Browser Window....

Posted 29 August 2002 - 09:23 PM

It looks like you are probably looping database records into a table. Couldn't you just check how many records you are going to output (queryName.RecordCount), and set the height based on that?

For example, say each table row is 25 pixels in height, you could add this to the head of the popup page (assuming queryName is the name of your cfquery and 500 pixels is the width you want):

<cfset windowHeight=queryName.RecordCount*25>
<script>
parent.resizeTo(500,<cfoutput>#Trim(windowHeight)#</cfoutput>);
</script>


Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2