Solved

open new undecorated window

Posted on 2004-10-03
6
375 Views
Last Modified: 2008-02-01
Hey

I got this Java applet I want to be opened in an undecorated frame (not full screen).
I understand I must do this with JavaScript when opening the window but I am not sure how to get rid of the titlebar etc or if its even possible.
It should look equivalent to a java application where Id set "frame.setUndecorated(true);"
Meaning no titlebar, no borders, no nothing - only the content. (the ability to drag it around and max,min,close buttons I will fix with Java)

0
Comment
Question by:snabben
  • 2
  • 2
  • 2
6 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 12212663
Hi snabben,

As good as it's going to get for Mozilla:
http://www.mozilla.org/docs/dom/domref/dom_window_ref76.html

For IE, you can use createPopup(), but this is more recommended:
http://www.dynamicdrive.com/dynamicindex8/chromeless.htm

Unfortunately, this doesn't work well with any SPs.


Therefore, you might want to check out createPopup() for IE:
http://www.webreference.com/js/tips/000523.html

Regards,
Zyloch
0
 
LVL 7

Expert Comment

by:Xxavier
ID: 12212781
something like this might work ie an iframe on adraggable layer, you can add buton to set the layer invisible/visible and unload/load the iframe

<script>
var concernedLayers=new Array()
concernedLayers[0]=new Array("aName",300,50)
//syntax is: entry[x]=new Array(LAYERName, its_WIDTH, its_HEIGHT)
//you can go on with indexes [1], [2]...
var engagedZindex=0;
var engaged=null;

//DOM detected build up:
if(document.getElementById){
obj1="document.getElementById('"
obj2="')"
style=".style"
eX=(navigator.appName.indexOf("Internet Explorer")==-1)?
"e.clientX":"event.clientX";
eY=(navigator.appName.indexOf("Internet Explorer")==-1)?
"e.clientY":"event.clientY";
offsetX=(navigator.appName.indexOf("Internet Explorer")==-1)?
"pageXOffset":"document.body.scrollLeft"
offsetY=(navigator.appName.indexOf("Internet Explorer")==-1)?
"pageYOffset":"document.body.scrollTop"
}
else if(document.all){
obj1="document.all['"
obj2="']"
style=".style"
eX="event.clientX"
eY="event.clientY"
offsetX="document.body.scrollLeft"
offsetY="document.body.scrollTop"
}
else if(document.layers){
obj1="document.layers['"
obj2="']"
style=""
eX="e.pageX"
eY="e.pageY"
offsetX="pageXOffset"
offsetY="pageYOffset"
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP)
}
//DOM build up now over

function events(e){//argument must be set as e
var Xin=eval(eX)
var Yin=eval(eY)
/*thanks to Dynamic HTML by Danny Goodman for
settings of following looping idea*/
for(var i=0;i < concernedLayers.length;i++){
var OGG=eval(obj1+concernedLayers[i][0]+obj2+style);
//is it visible?:
var visib=OGG.visibility
if(visib=="hidden"||
visib=="hide"){continue}
var layerW=concernedLayers[i][1]
var layerH=concernedLayers[i][2]
var L=parseFloat(OGG.left);//parseFloat: could carry a trailing "px" !
var T=parseFloat(OGG.top)
var offX=(document.layers)?0:eval(offsetX);//in case you scrolled
var offY=(document.layers)?0:eval(offsetY)
if(
Xin>(L-offX)&&Xin < (L-offX+layerW)&&
Yin>(T-offY)&&Yin < (T-offY+layerH))
{engaged=i;
moveX=Xin-L
moveY=Yin-T
engagedZindex=OGG.zIndex
setIndex(concernedLayers[i][0])
return}
}
engaged=null
/*keep this comment to reuse freely
http://www.unitedscripters.com */}

function setIndex(theLayer,how){
var OGG=eval(obj1+theLayer+obj2+style)
OGG.zIndex=(how)?how:101;
}

function disengage(){
if(engaged==null){return false}
setIndex(concernedLayers[engaged][0],engagedZindex)
moveX=null;
moveY=null;
engaged=null;
}

function dragLayer(e){
if(engaged==null){return false}
var Xin=eval(eX)
var Yin=eval(eY)
var OGG=eval(obj1+ concernedLayers[engaged][0]+ obj2+ style)
//now move it
OGG.top=Yin-moveY
OGG.left=Xin-moveX
/*keep this comment to reuse freely
http://www.unitedscripters.com */}

document.onmousedown=events
document.onmousemove=dragLayer
document.onmouseup=disengage
</script>

<html>

<head>
<title>New Page 1</title>
</head>

<body>
<div id="aName"
style="position:absolute;left: 40;top: 40;z-index: 3;display:block;width: 400;height: 420;background-color: #ffffff;background-layer-color: #ffffff;color:#000000;padding: 2;border-style: solid;border-width: 2;border-color: #0000ff">
&nbsp;<br>
<IFRAME src="http://google.com" height=400 width=400></IFRAME>
</div>

</body>
</html>
0
 

Author Comment

by:snabben
ID: 12213217
Xxavier: I still got titlebar, close button etc though .. thats what I want to get rid of, and itll still be there if i set the layer invisible right? Its a nice code though!

Zyloch: So you're basically saying that, in Mozilla, I can't get what I want. I tried without having anything set except height and width, and the result was that I still had titlebar and X _ buttons
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 36

Accepted Solution

by:
Zyloch earned 450 total points
ID: 12213317
Looks to be that way--it's what endears Mozilla to us all

You could use a layer like Xxavier shows, in a <div> ;)
0
 

Author Comment

by:snabben
ID: 12213840
Okay, thanks for the answers, Ill split the points to you guys!
0
 
LVL 7

Expert Comment

by:Xxavier
ID: 12214582
snabben, the div idea is that the page behind is an opening page say a link to open the  applet by changing the visbility, looks like a new window but is'nt. The title bar belongs to the opening page as it where.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
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…
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…

810 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