473,378 Members | 1,478 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,378 software developers and data experts.

maximise window problem with taskbar

If I use this code to maximise a browser window:

window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);

it works but on Windows the user can have a taskbar visible and the
browser window goes behind it.

Is there a way to know where the taskbar is?

Andrew Poulos
Jul 23 '05 #1
4 6301
Andrew Poulos wrote:
If I use this code to maximise a browser window:
No, you use it to *attempt* to "maximise" a browser window. Subtle
difference but a huge difference.
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
What makes you think I want my browser window to be 2048 pixels wide?
it works but on Windows the user can have a taskbar visible and the
browser window goes behind it.
I disagree with the "it works".
Is there a way to know where the taskbar is?


No. Stop trying to tell the user what size to have there windows, and it
becomes a moot point.
<URL: http://allmyfaqs.com/faq.pl?AnySizeDesign >


--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
Randy Webb schrieb:
Andrew Poulos wrote:
If I use this code to maximise a browser window:


No, you use it to *attempt* to "maximise" a browser window. Subtle
difference but a huge difference.
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);


What makes you think I want my browser window to be 2048 pixels wide?
it works but on Windows the user can have a taskbar visible and the
browser window goes behind it.


I disagree with the "it works".
Is there a way to know where the taskbar is?


No. Stop trying to tell the user what size to have there windows,
and it becomes a moot point.
<URL: http://allmyfaqs.com/faq.pl?AnySizeDesign >

Hello Andrew,

I absolutely agree with Randy. Nevertheless, if you absolutely want to
maximize the window, take a closer look at the screen object:

window.moveTo(screen.availLeft, screen.avail.Top);
window.resizeTo(screen.availWidth, screen.availHeight);

should be what you're looking for.

Greetings,
Jan
Jul 23 '05 #3
Jan-Christoph Ihrens wrote:
Randy Webb schrieb:
Andrew Poulos wrote:
If I use this code to maximise a browser window:
No, you use it to *attempt* to "maximise" a browser window. Subtle
difference but a huge difference.
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);


What makes you think I want my browser window to be 2048 pixels wide?
it works but on Windows the user can have a taskbar visible and the
browser window goes behind it.


I disagree with the "it works".
Is there a way to know where the taskbar is?


No. Stop trying to tell the user what size to have there windows,
and it becomes a moot point.
<URL: http://allmyfaqs.com/faq.pl?AnySizeDesign >


Hello Andrew,

I absolutely agree with Randy. Nevertheless, if you absolutely want to
maximize the window, take a closer look at the screen object:

window.moveTo(screen.availLeft, screen.avail.Top);


Of Internet Explorer 6SP1, Opera 6.05, Opera 7.54, Firefox 0.9.3, Mozilla
1.7.2 and Netscape 4.78. Only Firefox 0.9.3, Mozilla 1.7.2 and Netscape
4.78 support screen.availLeft/availTop. Your code works as written because
the "undefined" value returned by screen.availLeft/availTop is type
converted to 0 by the moveTo() method (which expects a Number). You may
want to make this type conversion explicit with:

window.moveTo((screen.availLeft || 0), (screen.availTop || 0));

doing this clearly shows that screen.availLeft can be "undefined" or null
on some user agents, and as a result, the coordinates of 0,0 are used in
those cases (which could potentially cover up a task or toolbar residing at
the top or left of the screen).
window.resizeTo(screen.availWidth, screen.availHeight);
window.resizeTo() in Netscape 4.xx resizes the browser's _viewport_ to the
specified values, not the outer browser window dimensions. As a result, you
end up with a window that is both too wide and too tall. The correct way to
resize the window in Netscape (if you insist on doing something or
proactively user hostile) is to adjust window.outerWidth/outerHeight.

window.resizeTo() in Opera 7.54 makes the MDI window inside Opera so wide
and tall that the scrollbar on the right is completely inaccessible. Oddly
enough, Opera 6.05 seems to be a bit more friendly under these
circumstances. It only makes the MDI window the maximum dimensions which
the outer MDI frame can accomodate.
should be what you're looking for.


Thankfully I can configure Firefox and other Gecko-based browsers to ignore
this nonsense entirely. In those cases, this page author will get nowhere
near the behaviour they are expecting.

This should be _clearly_ spelled out. More and more users are taking steps
to prevent Web site authors from messing with their browsers in these ways.
If your public Web site depends on a "fullscreen" window (which can have a
variety of meanings given multiple monitor configurations some users have),
you are fooling yourself if you think you can open everyone's browser
window to fill their screen.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #4
Jan-Christoph Ihrens wrote:
Hello Andrew,
This is a public newsgroup, not private e-mail.
[...] if you absolutely want to maximize the window,
take a closer look at the screen object:

window.moveTo(screen.availLeft, screen.avail.Top);
window.resizeTo(screen.availWidth, screen.availHeight);

should be what you're looking for.


It should not, see [de] <http://praast.de/ffq/abfrage/#monitor>.
PointedEars
--
This sig intentionally left blank.
Jul 23 '05 #5

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

Similar topics

1
by: Shayne H | last post by:
I want to be able to add a clock to the title of a VB.NET form. Simply updating the FormClass.Text property does not quite make it, the titile only changes once the form is minimised/maximised....
18
by: D Witherspoon | last post by:
I developed this module, examples on the internet seem to be much longer.. Can someone explain to me why my solution doesn't work? Module modAPI Declare Function SetForegroundWindow Lib...
8
by: WindAndWaves | last post by:
Hi Gurus I am a newbie.... and I was wondering if it is possible to maximise a screen in javascript. right now, I use this code: A HREF="heritage.html" onClick="msgWindow=window.open...
29
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the...
0
by: Rob Nicholson | last post by:
When debugging an ASP.NET program, I keep having to maximise the Internet Explorer window to full screen (to check that the grid based controls layout okay at 1024x768 screen resolution). Is...
4
by: Blaine | last post by:
Does anyone know how I can hide a form from the TaskManager? I've set the ShowInTaskbar to False, but when using Alt-TAB to switch between applications, it appears as a blank icon. I can set it...
1
by: Torben Laursen | last post by:
My windows program has a item on the taskbar as it should. But when my program opens a window inside the program that window also has a item in the taskbar. How do I prevent this so only the...
3
by: BlackShadow33p1 | last post by:
I'm trying to write a program in C++ that gets the handles of all the visible entries in the windows taskbar. The method I've used so far is to send the TB_GETBUTTON message to the taskbar. ...
10
by: Mark Rae [MVP] | last post by:
Hi, This is really just a theoretical question for my own interest, and not for any nefarious purpose... :-) Say we have three applications running - Notepad, Wordpad and Excel - and each...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.