Click to See Complete Forum and Search --> : resizing popup


nemex
12-11-2002, 02:53 PM
I am using this script to display images so that it opens without toolbars, status, etc., or even the title bar.

Example http://webdeveloper.earthweb.com/repository/webdev/content/software/2000/06/22/JS_28589/Script28589.html

<script language="javascript">
var Naked=null
function openNaked(){
if (Naked && !Naked.closed){ Naked.focus() }
else{
Naked=window.open("", "Naked", "fullscreen,scrollbars")
Naked.resizeTo(200,165)
Naked.document.write("<head></head><body topmargin=0 bottommargin=0 rightmargin=0 leftmargin=0>")
Naked.document.write("<img src='pic.jpg'></body>")}
}
</script>

-The window opens fullscreen and then resizes to 200x165. How can I set it so that it opens immediately (without fullscreen in other words) but according to the image's dimensions? I tried "Naked.document.images[0].width" and some other variations, but not working. I also tried calling a resize script within the head tags but that did not work either.

-Is there a way to eliminate the scrollbars? I tried simply taking out "scrollbars" from "fullscreen,scrollbars" but that doesn't work either.

Thanks very much.

sanny
12-11-2002, 03:18 PM
try this script: This will create a cromeless window for google website. You can also change the color if u want.

THIS CODE HAS BEEN COPIED FROM WWW.DYNAMICDRIVE.COM, THIS SITE HAS LOT OF GOOD EXAMPLES.

<script language="javascript" type="text/javascript" src="chromeless_35.js"></script>
<script language="javascript">

/*
Chromeless Window (v3.5)- By Gabriel Suchowolski (this credit MUST stay intact)
Author site at http://www.microbians.com
Visit http://www.dynamicdrive.com for this script
*/

//For paramater explanations, see accompanying faq.htm file
function openIT(u,W,H,X,Y,n,b,x,m,r) {
var cU ='close.gif' //gif for close on normal state.
var cO ='close.gif' //gif for close on mouseover.
var cL ='clock.gif' //gif for loading indicator.
var mU ='minimize.gif' //gif for minimize to taskbar on normal state.
var mO ='minimize.gif' //gif for minimize to taskbar on mouseover.
var xU ='max.gif' //gif for maximize normal state.
var xO ='max.gif' //gif for maximize on mouseover.
var rU ='restore.gif' //gif for minimize on normal state.
var rO ='restore.gif' //gif for minimize on mouseover.
var tH ='<font face=verdana size=2>Chromeless Window</font>' //title for the title bar in html format.
var tW ='Chromeless Window' //title for the task bar of Windows.
var wB ='#D5D5FF' //Border color.
var wBs ='#D5D5FF' //Border color on window drag.
var wBG ='#D5D5FF' //Background of the title bar.
var wBGs='#D5D5FF' //Background of the title bar on window drag.
var wNS ='toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0' //Html parameters for Netscape.
var fSO ='scrolling=auto noresize' //Html parameters for main content frame.
var brd =b||5; //Extra border size.
var max =x||false; //Maxzimize option (true|false).
var min =m||false; //Minimize to taskbar option (true|false).
var res =r||false; //Resizable window (true|false).
var tsz =20; //Height of title bar.
return chromeless(u,n,W,H,X,Y,cU,cO,cL,mU,mO,xU,xO,rU,rO,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO,brd,max,min,res,tsz)
}

</script>

CALLING THE FUCNTION:

<p><a href="#" onclick="mywin001=openIT('http://www.google.com',600,400,null,null,'mywin001',5,true,true,true);return false">
Open Google.com</a>


hopefully this helps