473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

OnTopic??Resolution

Maybe I could've picked a different, possibly more appropriate NG, but I'm
not sure.

I'm sure I'll get a decent answer from those in this NG though.

When creating a web site, taking into consideration different resolutions,
is it best and/or industry standard to use pct. for images or create
something like...

if (screen.height >= 768 && screen.width >= 1024) {
document.write("<img src='http://your-web-site-address-here.com/image.gif'
width=850 height=11 border=0>");
}
else {
if (screen.height == 600 && screen.width == 800) {
document.write("<img src='http://your-web-site-address-here.com/image.gif'
width=600 height=11 border=0>");
}
else {
document.write("<img src='http://your-web-site-address-here.com/image.gif'
width=475 height=11 border=0>");

.... etc.

I know there are many more resolutions, so that's one of the reasons why I
ask.

The main page of the site is an image, well mostly an image. with just a few
links (horizontally) at the bottom. This should all fit into one page.

If not the appropriate NG, I'm sure someone will kindly let me know,

Thanks,
Michael
Jul 23 '05 #1
1 1184
Michael Tonelli wrote:
Maybe I could've picked a different, possibly more
appropriate NG, but I'm not sure.
You have posted javascript code and a scripted approach so that at leas
is on topic. The eventual solution is unlikely to be scripted so it is
probably to be found elsewhere.
I'm sure I'll get a decent answer from those in this
NG though.
There is no harm in being optimistic :)
When creating a web site, taking into consideration different
resolutions, is it best and/or industry standard to use pct.
Is "pct" percentages, referring to CSS styling of the image width and
height? Or percentages in the width and height attributes of the IMG
tag?

'industry standard' is not necessarily a good benchmark if it mans what
is normally/commonly done in (non-personal) web sites, because
relatively few of the people responsible for the creation of web sites
have any skills beyond the operation of a limited range of web-related
software products.

'best', on the other hand, depends entirely on what you are trying to
do, and why.
for images or create something like...
No, don't do that at all. CSS and javascript are optional technologies
that may be independently available or unavailable on the client, and
subject to some user configuration/constraints even when available.
Making page content dependent on an optional technology is a sure path
to unreliable outcomes.
if (screen.height >= 768 && screen.width >= 1024) {
The - screen.height/width - property most often (when supported) reports
the total dimensions of the desktop in pixels. That parameter is
unrelated to the size of the browser window. At best it may represent a
constraint on the maximum size of the browser window. Though the maximum
size of the browser window is itself no more than a constraint on the
size of the view/client area of the browser window. The browser window
must also accommodate the size/dimensions of window chrome and
alternative panels, which may vary with every user.

If you must use a script to determine the size of something based on the
user's view of a web page you should at least base that decision on the
view/client area dimensions. The group's FAQ shows code for that task,
though better algorithms are possible.
document.write("<img
src='http://your-web-site-address-here.com/image.gif'
width=850 height=11 border=0>"); }
In valid HTML 4.01 the IMG element has a required ALT attribute that is
missing form your code.
else {
if (screen.height == 600 && screen.width == 800) {
The first set of comparisons are greater than or equal, these are only
equals, leaving a range of desktop sizes between 600/800 and 768/1024
defaulting to the smaller image defined below. That is not a logically
consistent thing to be doing.
document.write("<img
src='http://your-web-site-address-here.com/image.gif'
So is this the same "image.gif" as above? Making this an exercise in
image scaling. Browsers are generally appallingly bad at scaling images.
width=600 height=11 border=0>"); }
else {
document.write("<img
src='http://your-web-site-address-here.com/image.gif'
width=475 height=11 border=0>");

... etc.

I know there are many more resolutions, so that's
one of the reasons why I ask.
Browser window dimensions are extremely variable,
non-maximised/fullscreen windows are actually unlikely to be the same
size for the same user over two consecutive visits to a web site, let
alone across many visitors.

The most viable response to that variability is what is know a "fluid
design" and is mostly achieved with CSS. The CSS is designed to
constrain the way that the page contents flow within the container of
the browser window, but the fact that the contents are allowed to flow
accommodates an enormous range of browser window sizes.

Fluid design doesn't work that well with images but that is directly
because browsers are so appalling at scaling images.
The main page of the site is an image,
That is quite unusual in itself, and warrants some additional
explanation.
well mostly an image. with just a few links (horizontally)
at the bottom. This should all fit into one page.
Everything will fit onto one page whatever you do, but some of those
pages may have scroll bars.
If not the appropriate NG, I'm sure someone
will kindly let me know,


Javascript is almost certainly the wrong technology, but without knowing
exactly what you are doing and why there can be no additional advice on
a direction to take.

Richard.
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
1
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
12
by: techie | last post by:
Hi All, I have a portal working on an intranet for a company. The portal was designed keeping in mind the resolution of 1024*768. I am including a ..css file in all the files. Now i have to make...
2
by: Michael Evans | last post by:
First, we rely on a stable update rate so that our physics and dynamics calculations and integrations are based on a known interval and therefore are true-to-life. Second, the graphics positions...
6
by: Darian | last post by:
I am wondering how (if it is possible of course) I can change a users screen resolution to a certain size when running my application and then change it back when they exit my application. For...
7
by: tim | last post by:
can someone tell me which function returns the screen resolution in java script?
5
by: Maxi | last post by:
I have a 30X16 cells table in my html page. Table height and width are set to 100%. I have set size of every cell inside the table to 24 pixel. When I open the html page in maximize state in...
2
by: Steve | last post by:
I'm trying real hard to set the printer resolution for a PrintDocument. It appears that the printer is already set to 300 x 300 dpi, which is JUST what I want. But the Margins and PrintableArea...
7
by: Peter Oliphant | last post by:
In today's market, what's a good screen resolution that I can pretty much count on as being the minimum? This is kind of a 'fuzzy' question in that I'm interested in the biggest screen...
6
by: | last post by:
Hi, I need to get the the display monitor native resolution.I have tried SystemInformation.PrimaryMonitorSize. it is giving the exisiting resolution of the display monitor that is connected....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.