PDA

View Full Version : Help - Code discrepency - Full Screen code



kurson
04-05-2006, 09:08 PM
I am apply code from: http://www.dynamicdrive.com/dynamicindex8/window1.htm

Locally this code works great...The wiondow pops open and I see nothing but the code on the page...No Header bar, no footer bar, no tool bars. YET, when I open the page from the remote server, the header strip and footer strip display. Question? Why?

Twey
04-05-2006, 09:29 PM
Security measures.

kurson
05-05-2006, 09:24 PM
Hi. COuld you elaborate on the answer "Restrictions"? Thanks.

jscheuer1
05-05-2006, 10:12 PM
Since, without at least the title and status bars, it would be very easy to fool someone into thinking that they were somewhere else on the web than they actually are, this has been impossible to remove from a live window for quite some time.

Your desire to do this is probably innocent enough but, professional thieves would love to be able to do this to scam folks into thinking that they are on the official website of, say - a bank, when in fact they are submitting personal information directly to the thieves.

lihang
05-10-2006, 07:22 AM
Maybe, the code in the remote server for that button is different from that in the text you copied

kurson
05-10-2006, 06:01 PM
Hi all.

Thank you for participating on this thread. Please note that I have resolved the issue of my initial inquiry with success.

Please visit this site:

http://www.pageresource.com/jscript/jwinopen.htm

I am able to do most of what I want with this code:

------------------

if((FullScreenFlag == "Hidden Tool Bars") && (config != "YES")) {

window.open(url1, "", "top=0,left=0,width=1024,height=768,scrollbars,toolbar=no,status=yes,menubar=no,directories=no,titlebar=yes");

window.location = '../../users/dc4d/dc4d.html';

--------------------

My sticking point is the code: width=1024, height=768.

I need the pop-up screen to be full screen, regardless of if I am on a 1024x768 calibrated monitor or a 1280x1024 calibrated monitor. I cannot simply set the width and height to a static variable as people set their monitors to different sizes.

As far as everything else, as you all can see, creating a pop up box that ONLY displays the header strip and footer strip display is quite possible.

If anyone has a lead on this, I'm all ears.

Twey
05-10-2006, 06:53 PM
window.open(url1, "", "top=0,left=0,width=" + screen.width + ",height=" + screen.height + ",scrollbars,toolbar=no,status=yes,menubar=no,directories=no,titlebar=yes");

kurson
05-10-2006, 10:23 PM
Hi all.

To Twey: your code:

width=" + screen.width + ",height=" + screen.height + ",

This works. Thank you. The only aspect that is off is that the window that pops open is not docked, it can be moved, and the window pops in a way that the screen's status bar is covered slighltly by my monitor's "black space" at the bottom of the IE window rather than having the effect that occurs when I click the "maximize" button at the top right hand corner of the page.

Is there a way to dock and maximize the window upon popping it?

All replies are, as always, appreciated.

Twey
05-10-2006, 10:59 PM
Not insofar as I know.
and the window pops in a way that the screen's status bar is covered slighltly by my monitor's "black space"Then your monitor needs fiddling with. None of your desktop should be hidden.

jscheuer1
05-11-2006, 03:55 AM
Hi all.

To Twey: your code:

width=" + screen.width + ",height=" + screen.height + ",

This works. Thank you. The only aspect that is off is that the window that pops open is not docked, it can be moved, and the window pops in a way that the screen's status bar is covered slighltly by my monitor's "black space" at the bottom of the IE window rather than having the effect that occurs when I click the "maximize" button at the top right hand corner of the page.

Is there a way to dock and maximize the window upon popping it?

All replies are, as always, appreciated.

For some reason. IE can't seem to calculate both the size that the window will be and the size of something like the screen width/height at the same time, include an allowance for the window's chrome and get it right. For this reason, in the past, I've always recommended setting the action of opening the window to a variable:


var newWin=window.open(whatever)
newWin.moveTo(0,0);
newWin.resizeTo(screen.width, screen.height);

This will usually allow IE to get it right because, by that point, it has already got the window's chrome in place. You should still use whatever specifications for the window's size and position you desire in the window.open() method as, many other browsers will both 'get it right' the first time while also not allowing you to resize or move the window once it is open.

Also, screen.availWidth and screen.availHeight are better choices here, that will make allowance for the the screen's taskbar (if any).

I said, "in the past" because, although these practices are still sound and workable, it has come to my attention that there is an IE specific specification that (depending upon the type of window you want) may be superior to all this. It is the fullscreen specification:


if (document.body.filters) //IE only
window.open('page.html','name','fullscreen')
else
window.open( . . . normal window open parameters and specifications . . .)

You may not like the characteristics of this fullscreen window for your purposes though, in which case try the 'in the past' method.

I am not aware of any way to prevent the moving of javascript opened windows other than polling, which would probably be a bad idea.

kurson
05-19-2006, 05:37 PM
Hi All.

Thank you all for participating on this forum topic.

To jscheuer1: your code below works:

var newWin=window.open(whatever)
newWin.moveTo(0,0);
newWin.resizeTo(screen.width, screen.height);

ONE LAST THING:

I do not want the window to move once it's been popped up. I need to someone greyout and disable the "Restore Down" icon at the top right hand corner of the title bar (and perhaps the minimize and close icons too)

Does anyone out there know how to do that?

Any advice is appreciated.

Twey
05-19-2006, 06:21 PM
It is not possible.

kurson
05-19-2006, 06:57 PM
Hi all

Thank you for participating on this forum board thread.

How does one "DOCK" The Internet Explorer window?

I know that this is possible. The ability to make the IE window not move so it's not draggable.

This should be a simple one-liner for those that are in the know.

Any feedback is appreicated.

Twey
05-19-2006, 06:59 PM
Well, this might work:
window.onmove = function(){window.moveTo(0,0);return false;};But it still sounds like something that should be blocked by most modern browsers. I know it won't work with Firefox.

kurson
05-22-2006, 09:31 PM
Hi.

In reply to Jscheuer1, I implemented your code

var newWin=window.open(whatever)
newWin.moveTo(0,0);
newWin.resizeTo(screen.width, screen.height);

Locally it works great. My page pops open and takes up the full screen.

On the live site, from my server, The new window does not cover the bottom of the window where the start icon, minimize tray and CPU clock lives.

Do you or anyone else understand why there is this discrepancy?

Is there specific code I may write that says cover this region as well?

Your continued participation on this thread is appreciated.

jscheuer1
05-22-2006, 09:36 PM
What is your target browser and is this for the web or for a local intranet?

kurson
05-23-2006, 02:03 AM
Hi jscheuer1.

My code is for IE on the web. I also run it locally on a single machine running IIS.

It shows two different results. Locally the page spans the screen, This sdoes not occur on-line, on the web, the start menu and icon bar displaying at the bottom of the screen. I'm stumped.

jscheuer1
05-23-2006, 05:21 AM
Have you tried the 'fullscreen' specification from post#10 (http://www.dynamicdrive.com/forums/showpost.php?p=35674&postcount=10) in this thread?

Anyways, it may be security feature or be because IE has more time to allow for the taskbar due to the lag time of running the code from the web.