Solved

How to create a borderless window

Posted on 2002-07-30
14
3,356 Views
Last Modified: 2007-11-27
I want to have a borderless window (not frame) in my intranet application.

Does anyone know how to do it?

Thanks
0
Comment
Question by:hayri
  • 7
  • 2
  • 2
  • +3
14 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7188636
window.open("http://www.cnn.com","cnn","height=400,width=400,toolbar=no,scrollbars=no,resizable=no,menubar=no,screenX=0,screenY=0")

Fritz the Blank
0
 

Author Comment

by:hayri
ID: 7188719
window.open("http://www.cnn.com","cnn","height=400,width=400,toolbar=no,scrollbars=no,resizable=no,menubar=no,screenX=0,screenY=0")

above window.open statement is creating a window with the title bar at the top where it says "Microsoft Internet Explorer" ,  and I want to avoid that plus I want to get rid of the chrome border around the browser window or alter that to my taste by changing its style, color and etc.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7188755
I don't know that you can get rid of the titlebar or border.

Fritz the Blank
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7188928
You can try this:

<BODY onload='JavaScript:window.open("http://www.cnn.com","cnn","fullscreen=yes,toolbar=no,scrollbars=no,resizable=no,menubar=no,screenX=0,screenY=0")'>


Fritz the Blank
0
 

Author Comment

by:hayri
ID: 7188973
It actually works but only on full screen mode. I want the window to be in a fixed size (500x500) and not resizable and cannot be maximized
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7188984
Then I am afraid that you are stuck with the title bar.

Fritz the Blank
0
 
LVL 3

Expert Comment

by:malcx
ID: 7190041
...unless you use an HTA...

It's IE only, and may be a totally unsuitable solution for your situation - see
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7191168
This is supposed to work, but I haven't had the chance to try it:

==============================================================
Script:     Amazing Frameless Popup Window - Version I

Functions:  In IE4 and later, this script launches a popup
            window without the Windows frame or titlebar
            (that is, a "containerless" window).  In other
            browsers, it launches a standard popup window.
            Position, width, and height are settable.
            Automatic closing of the window on leaving the
            page may also be optionally set.

Browsers:   IE4 and later
            Degrades fully functionally in other browsers

Author:     etLux
==============================================================

STEP 1.
Inserting the <script> in your page

Put the following <script> </script> in the head
section of your launching page.  

Set the variables as indicated in the script.

<script>

// Amazing Frameless Popup Window - Version I
// (C) 2000 www.CodeLifter.com
// Free for all users, but leave in this  header

// set the popup window width and height

var windowW=214 // wide
var windowH=398 // high

// set the screen position where the popup should appear

var windowX = 260 // from left
var windowY = 100 // from top

// set the url of the page to show in the popup

var urlPop = "yourpage.html"

// set the title of the page

var title =  "This Is A Frameless Popup Window"

// set this to true if the popup should close
// upon leaving the launching page; else, false

var autoclose = true

// ============================
// do not edit below this line
// ============================

s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false

function openFrameless(){
  if (beIE){
    NFW = window.open("","popFrameless","fullscreen,"+s)    
    NFW.blur()
    window.focus()      
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
  } else {
    NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
    NFW.blur()
    window.focus()
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
  }  
  NFW.focus()  
  if (autoclose){
    window.onunload = function(){NFW.close()}
  }
}

</script>

==============================================================

STEP 2.
Triggering the popup window

Call the openFrameless function from a link, like this:

<a href="javascript:openFrameless()">click here</a>

==============================================================

STEP 3.
Conditioning the page that goes in the popup window

Add the following call to the <body> tag of the page that
will open in the popup *if* your popup does not come to the
front after it loads.  This is occasionally needed in early
versions of IE4, and with certain types of page content that
manipulate focus. If in doubt, put it in -- it can't hurt.

<body onload="top.window.focus()">

==============================================================

ADDENDUM 2/22/2001
Making the Frameless Popup Center on the Screen Automatically

We've had numerous requests for this, and a minor modification
of the script can do it.  Here's how...

Comment out the two lines as shown, and add the two shown below
them.

// set the screen position where the popup should appear

//var windowX = 260 // from left
//var windowY = 100 // from top
var windowX = (screen.width/2)-(windowW/2);
var windowY = (screen.height/2)-(windowH/2);

==============================================================


Fritz the Blank
0
 
LVL 1

Expert Comment

by:vijayneema
ID: 7200462
hi,

Try this:
window.open("http://www.vijayneema.com", '_splash', 'fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0' );


-vijayneema
0
 
LVL 1

Expert Comment

by:vijayneema
ID: 7200469
Sorry this is the complete code. but still not tested :(


var w = window.screen.width;
var h = window.screen.height;
var l = (left != null) ? left : (w-width)/2;
var t = (top != null) ? top : (h-height)/2;

splashWin = window.open("www.vijayneema.com", '_splash', 'fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0' );

splashWin.blur();     // Hide while updating
window.focus();
     
splashWin.resizeTo(width,height);
splashWin.moveTo(l, t);
splashWin.focus();

-vijayneema
0
 
LVL 12

Expert Comment

by:ahosang
ID: 8334710
This question has been abandoned. I will make a recommendation to the moderators on its resolution in a week or so. I appreciate any comments that would help me to make a recommendation.
 
In the absence of responses, I may recommend DELETE unless it is clear to me that it has value as a PAQ. Silence = you don't care
 
ahosang
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 100 total points
ID: 8334735
Points to me on this one?

Fritz the Blank
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8341872
So, here we go again.....

How could I have answered more completely here? I would like to know how to earn the A next time. The code above is still not enough?

Fritz the Blank

0
 

Expert Comment

by:snapsy
ID: 10736601
Hello Fritz,
Using your code to create borderless window, I could not control the height of the window quite the way I wanted.
If I set the heigth to say 45 pixels tall, it will create a window with appr. 90-100 pixels tall. Is there is minimum
height in HTML or is there a way to get around it.

Thanks.

Sam.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now