Opening a Window without a Titlebar

Is this possible, and how is it done?
That is, what feature would be set on a window.open()?
LVL 10
ClifAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kanthonymConnect With a Mentor Commented:
HERE YOU GO!.

IF this does not make sense see the code examples and text at the link below.

 
 

New Window: No Title Bar
by Joe Burns, Ph.D.
Use these to jump around or read it all...


[Button Code]
[The Script]
[OnLoad the Window]

In my tutorial dedicated to opening new windows through JavaScript, I made the statement you could not open a new window that didn't have a title bar. Don't check. It doesn't say that any more.

A reader saw that statement and informed me that he knew of a method and gave me the basics. I took those steps and put together the script in this tutorial. It's a new window that opens without a title bar. The effect is created by using the open.window JavaScript along with the fullscreen code discussed in this tutorial.

Sorry to say that even though the fullscreen and JavaScript commands work in Netscape, the loss-of-title-bar effect only works in Internet Explorer. However, I've bulked up the script so that not only do you have control over the title bar, but also o over the window's size and placement on the screen. It's a neat little piece of work. Dig this:


 
Neat effect, eh?

Hey, did you get a scrollbar? Yeah. Me too. I have the scrollbars set to "no" but that thing still pops up. Strange, huh? If you'd like to get rid of the scrollbar too, then follow a tip given to me by Neil Brocklebank.

In the page that opens in the new window put the style command:

style="overflow:hidden"

...in the BODY flag. Now, remember. That goes in the BODY flag of the page that is opening inside the new window, not the page that contains the script. That's real important.



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


Button Code
It goes like this:
<CENTER>
<FORM>
<input type="button" VALUE="click me!" onClick="goNewWin()">
</FORM>
</CENTER>


It's a basic FORM button that is set up to fire a function named "goNewWin()". That's about all there is to it. Let's see that script.



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


The Script Code
The script is inside of a function. Here it is:
<script language="JavaScript">

function goNewWin() {

// Set height and width
var NewWinHeight=200;
var NewWinWidth=200;

// Place the window
var NewWinPutX=10;
var NewWinPutY=10;

//Get what is below onto one line

TheNewWin =window.open("untitled.html",'TheNewpop',
'fullscreen=yes,toolbar=no,location=no,directories=no,
status=no,menubar=no,scrollbars=no,resizable=no');

//Get what is above onto one line

TheNewWin.resizeTo(NewWinHeight,NewWinWidth);
TheNewWin.moveTo(NewWinPutX,NewWinPutY);

}
</script>

We start by setting four parameters:

// Set height and width
var NewWinHeight=200;
var NewWinWidth=200;

// Place the window
var NewWinPutX=10;
var NewWinPutY=10;

http://www.htmlgoodies.com/beyond/notitle.html

Good Luck!
 
 
 
0
 
kanthonymCommented:
Probably noit possible if you are talking about the title bar above the file menue. However, you can not place title infomration in there.

<script language='javascript'>
//-- This function opens the new, empty window named floater.
function openWindow() {
   winStats='toolbar=no,location=no,directories=no,menubar=no,'
   winStats+='scrollbars=no,width=275,height=175'
   if (navigator.appName.indexOf("Microsoft")>=0) {
      winStats+=',left=10,top=25'
    }else{
      winStats+=',screenX=10,screenY=25'
    }
   floater=window.open("","",winStats)    
}
0
 
kanthonymCommented:
More window related code.


<SCRIPT LANGUAGE="javascript">
<!--
window.open ('titlepage.html', 'newwindow', config='height=100,
width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no')
-->
</SCRIPT>
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
ClifAuthor Commented:
kanthonym:
Thanks for your help so far.

this is really close.  There are two problems, though.  First of all, there is a definite lag during the window opening before it gets resized.  Second, the "fullscreen" feature is (according to my documentation) only used in IE4.
0
 
ClifAuthor Commented:
kanthonym:
I'm go9ng to go ahead and grade your answer.  It does work (at least in IE), although there is that annoying lag.

I just discovered what I was trying to do can't be done in Netscape anyway, so I'll have to try and find another plan.

Thanks for your help.
0
 
kanthonymCommented:
Thanks, best of luck in your search. I would be very interested in any answers you find.  katnthonym@hotmail.com
0
All Courses

From novice to tech pro — start learning today.