PDA

View Full Version : not quite full screen


redmonkey
09-04-2001, 07:27 PM
Hi all

I am new to web programming in general and I don't know a lot about javascript, But I am trying to make a website I'm working on come up full screen (at my bosses request). I read the tut here and i am trying to modify it a little but I'm not sure how. I would like to leave the title bar at the top that lets you close the window. In the tests I've done it is possible to close the window on NN for PC and Mac and Mac IE5 BUT for PC IE it doesn't have the title bar.

If you want to see how it should work go to http://www.heavy .com

How can I restore the title bar on PC IE5

thanks,

here is the code I'm using:
-------------------------------------------
<html>
<head>
<title>Red Monkey Ads</title>
<script language="JAVASCRIPT">

<!--


function detectVersion()
{
version = parseInt(navigator.appVersion);
return version;
}

function detectOS()
{
if(navigator.userAgent.indexOf('Win') == -1) {
OS = 'Macintosh';
} else {
OS = 'Windows';
}
return OS;
}

function detectBrowser()
{
if(navigator.appName.indexOf('Netscape') == -1) {
browser = 'IE';
} else {
browser = 'Netscape';
}
return browser;
}

function FullScreen(){

var adjWidth;
var adjHeight;

if((detectOS() == 'Macintosh') && (detectBrowser() == 'Netscape')) {
adjWidth = 20;
adjHeight = 35;
}
if((detectOS() == 'Macintosh') && (detectBrowser() == 'IE')) {
adjWidth = 20;
adjHeight = 35;
winOptions = 'fullscreen=yes';
}
if((detectOS() == 'Windows') && (detectBrowser() == 'Netscape')) {
adjWidth = 30;
adjHeight = 30;
}
if(detectVersion() < 4) {
self.location.href = 'main.html';
} else {
var winWidth = screen.availWidth - adjWidth;
var winHeight = screen.availHeight - adjHeight;
var winSize = 'width=' + winWidth + ',height=' + winHeight;
var thewindow = window.open('main3.html', 'monkey', winSize);
thewindow.moveTo(0,0);
}
}

function MakeItSo(){
if((detectOS() == 'Windows') && (detectBrowser() == 'IE')) {
window.open('main3.html','monkey','fullscreen=yes' );
} else {
onload=FullScreen();
}
}
// -->

</script>
</head>

<body bgcolor="#ffffff" text="#000000" id=all>
<a href="javascript:MakeItSo();">Release Red Monkey</a>


</body>
</html>

Jesse
09-05-2001, 03:09 AM
This tutorial was designed originally to remove the bar that you speak of. If you want to pop a window which is the same size as the screen but still has the title bar, you'd prolly be better off finding a different script. Maybe try: http://www.javascript.com/