Click to See Complete Forum and Search --> : make browser full-screen on opening


mjstwo
01-30-2004, 07:04 AM
hi

I'd like my index page to fill the users screen automatically when they go to the URL - not expand but open at 100% screen-size

can anybody help..?

many thanks

olerag
01-30-2004, 07:43 AM
<script type="text/javascript">
var newWin;

function openWin(val) {
var w = screen.width;
var h = screen.height;
var l = 0;
var t = 0;
var winAtt = "width="+w+",height="+h+",top="+t+",left="+l+" ,scrollbars=1,toolbar=1,menubar=1,resizable=1,loca
tion=1,status=1";
newWin = window.open(val, "newWin", winAtt);
}
</script>

mjstwo
01-30-2004, 07:46 AM
...I assume this goes in the head..?

olerag
01-30-2004, 07:51 AM
Sure, that'll work. You can call it from whatever event you
prefer.

It'll open a new window the size of the screen and have all
of the browser's attributes available.

mjstwo
01-30-2004, 07:59 AM
..I'll try it today

rhsunderground
01-30-2004, 11:06 AM
this script is basically the same as olerag's, but a little shorter. it checks to see if the title of the window is 'fullscreen.' if it isn't, it opens a window of the same location with that title. you have no menu's at all, so it is truly fullscreen.

<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (this.name!='fullscreen'){
window.open(location.href,'fullscreen','fullscreen,scrollbars')
}
// End -->
</script>
</head>
<body>
shoes.
</body>
</html>


if you want your window to be viewed ONLY in fullscreen, the best i've found is this one ---> it closes the original window, assuming the user allows it, and then opens a new fullscreen window of that page.

<html><head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (this.name!='fullscreen'){
window.open(location.href,'fullscreen','fullscreen,scrollbars')
window.close(self)
}
// End -->
</script>
</head>
<body>
asdfasdflajsdf
</body>
</html>

for an example of this, go to this page (http://rhsunderground.netfirms.com/test.htm), preferably in IE 4+, and check it out. if you want to play around in there, the password is 'ourpage.'

mjstwo
01-31-2004, 12:15 PM
...thanks rhsunderground I'll try yours too - olerags didn't work unfortunately - I'm not a Jscript coder but I think there may be some unwanted spacing in the code as posted..? - when I paste it into the head then browse the page the java is visible on the page...

I really need the page to have all the normal nav but just fill the screen as it opens

PhillMc
01-31-2004, 12:28 PM
Your scripting could be disabled. From what I am seeing in his code it should work and spacing shouldn't be an issue. Make sure <SCRIPT> tags are in place, (ie <SCRIPT> the stuff inside </SCRIPT>) if those aren't in place, you will definately see the script on the screen as text.

Also, try pasting in the body tags first thing. Sometimes I have probs with runnings script in head

neil9999
01-31-2004, 01:36 PM
Sometimes, if you copy some characters to a program other than notepad, it doesn't work. For example if you paste <SCRIPT> to Frontpage HTML mode, it pastes as &lt;SCRIPT&gt;. Paste to notepad first, and then copy from there to the program you're using.

Neil

mjstwo
02-04-2004, 11:15 AM
...the most I'm getting is the window goes up into the top-left of the screen while retaining the size of the last browser window that was open (if you see what I mean..?

I'm doing it on a Mac, don't know if that's why I'm having problems..?

just to double check - I want this to work on a new URL (ie its in the head of the index page), not to be a button that opens a new window
many thanks

Mike

rhsunderground
02-04-2004, 11:18 AM
oh, well your first problem is that you're using a mac. your second problem is that the code i provided hates macs, and the feeling is mutual. your third problem is that you're still using a mac. i've not seen one of these codes that works on a satan-box, but then again, i've not tried too hard.



best of luck on purchasing your new PC.