Help with dynamic web page size

starwarsdad

Golden Member
May 19, 2001
1,433
0
0
I am trying to make my pages on my website show up dynamically based on the size of the users browser window.

I program in ColdFusion (with a lot of help from my project manager).

I think I will need a javascript to get the window size (not the screen resolution). Once I have the window height and width, how do I pass them to ColdFusion to start building my pages.

Many thanks!

SWD


edited for spelling
 

Cheetah8799

Diamond Member
Apr 12, 2001
4,508
0
76
I think you'll want to learn how to do this with CSS. I haven't had time to learn it myself, but it's probably a good place to start looking.

Or you could also maybe do it with javascript.

Basically though you DO NOT pass the information back to your server. Cold Fusion is server side programming language, like PHP, and you want to do CLIENT SIDE programming. Your server won't know what the client is using, so you have to have code that runs on the client's machine to take care of that. CSS and Javascript are client side.

know what I mean?


If you really wanted to do it server-side in Cold Fusion or PHP. What you could do is have the first page set so ALL users are forced to see it, then have that page setup with some javascript that will create some cookies that contain the client browser's info. Then subsequent ColdFusion pages can check those cookies and render pages with the proper size settings.

This isn't an ideal approach though, because people with bookmarks will be forced back to a page they didn't bookmark... I've had to do this for one of my clients, and I don't like it, but that's what he wanted...
 

edmicman

Golden Member
May 30, 2001
1,682
0
0
ummmmm, don't you just use tables with relative widths, ie., "80%" instead of setting the width to a specific pixel size??

if you want to actually resize the size of the window to specific dimensions, i'd use javascript.
 

starwarsdad

Golden Member
May 19, 2001
1,433
0
0
I really need buy a book on CSS. I have been avoiding it, but it seems inevitable.

I usually do mostly "back-end" programming that site users don't see. When I start trying to work on "display" pages and layouts my inexperience really comes out
 

Cheetah8799

Diamond Member
Apr 12, 2001
4,508
0
76
Originally posted by: starwarsdad
I usually do mostly "back-end" programming that site users don't see. When I start trying to work on "display" pages and layouts my inexperience really comes out

Same here. I'm more of a PHP and MySQL programmer. I'm not a good artist... I leave the graphics to other people whenever I can.
 

starwarsdad

Golden Member
May 19, 2001
1,433
0
0
I figured I would need to use javascript. Unfotunately, I don't know js. I can kind of tweak other people's scripts to my own needs at times. I tried some of the script sites, but I did not see anything like what I want to do.
 

starwarsdad

Golden Member
May 19, 2001
1,433
0
0
I wish I could leave front-end and graphics alone but apparenty I need to learn that end too.
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
have these sites bookmarked for your references:
syntax and usage references
designing "user friendly" websites

by the way, just a note from fellow programmer-have-to-do-frontend-design-code-monkey...
when you are learning css and/or javascript, try your best to avoid the various "hacks" that was invented to get around browser incompatibilities.
i.e.: try not to use hacks just to make your stuffs work on multiple browsers unless you really really really have to.

why?
it will confuse yourself in the process of learning new things
it also looks ugly to have all those hacks all over the place, and discourage the advance of the so-called-oh-almighty "web standards"

stay with the KISS mentality, learn new things here and there, experiment new things, and don't be afraid to ask -)

(yeah, i know this has nothing to do with the original question. but since CSS and layout design were mentioned .... i thought, heck why not?) ,p
 

AFB

Lifer
Jan 10, 2004
10,718
3
0
Originally posted by: stndn
have these sites bookmarked for your references:
syntax and usage references
designing "user friendly" websites

by the way, just a note from fellow programmer-have-to-do-frontend-design-code-monkey...
when you are learning css and/or javascript, try your best to avoid the various "hacks" that was invented to get around browser incompatibilities.
i.e.: try not to use hacks just to make your stuffs work on multiple browsers unless you really really really have to.

why?
it will confuse yourself in the process of learning new things
it also looks ugly to have all those hacks all over the place, and discourage the advance of the so-called-oh-almighty "web standards"

stay with the KISS mentality, learn new things here and there, experiment new things, and don't be afraid to ask -)

(yeah, i know this has nothing to do with the original question. but since CSS and layout design were mentioned .... i thought, heck why not?) ,p

There are so many CSS quirks that its not even funny.
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Doing layouts using CSS can be an extremely frustrating exercise.. I've decided that I'll only test those websites on Firefox and IE5.5/6.. it's simply too time-consuming to find hacks for other (less-used) browsers
 

rh71

No Lifer
Aug 28, 2001
52,856
1,048
126
I'm not aware of a way to detect browser window size... only screen resolution...

In the case of the latter: (sample)

<SCRIPT language="JavaScript">
<!--
if ((screen.width>=1024) &amp;&amp; (screen.height>=768))
{
window.location="highres.cfm";
}
else
{
window.location="lowres.cfm";
}
//-->
</SCRIPT>

You can set your CF vars within those pages...
 

starwarsdad

Golden Member
May 19, 2001
1,433
0
0
I found the w3schools site in my Googling yesterday and have actually been going through their CSS tutorial.

It is very aggravating, but I suppose, a necessary evil. Why set a class to center? Why not just align center That just makes too much sense.

Many thanks for the advice and links!
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
why set class to text-align:center; instead of using <div align='center'>, you ask?
imagine that one day your boss decide to change all the center-aligned texts to left alignment.
would you rather change <div align="center"> to <div align="left"> on all of your files,
or would you rather change one line in your class that says text-align:center to text-align:left ?

it's over simplistic example, but .. you get the idea ,p

welcome to the wonderful world of css ... -)
where, unfortunately, standards vs "standards" are everywhere -(
 

AFB

Lifer
Jan 10, 2004
10,718
3
0
Originally posted by: stndn
why set class to text-align:center; instead of using <div align='center'>, you ask?
imagine that one day your boss decide to change all the center-aligned texts to left alignment.
would you rather change <div align="center"> to <div align="left"> on all of your files,
or would you rather change one line in your class that says text-align:center to text-align:left ?

it's over simplistic example, but .. you get the idea ,p

welcome to the wonderful world of css ... -)
where, unfortunately, standards vs "standards" are everywhere -(

Yeah, there seems to be a lot of standards and even more stndeereds(Sic).
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |