Forum Moderators: open

Message Too Old, No Replies

Lost code and forgot how and can't find it again.

         

dccawthon

10:29 pm on Mar 18, 2006 (gmt 0)

10+ Year Member



I use one of the friends pages and they don't allow java script. So I first use a link to open a page in a new browser window.

When I open this page I want to automatically resize to about width="420" height="350" and open another webpage in that frame. I don't need a status bar or address bar. Only thing that I need to show is the X at the top so after a movie is done, they can close the window.

I searched for hours for this code and finally found it. I forgot to back it up and I did a reload on my ftp and overwrote it.

This code originally showed a frames page that looked was one frame on top of the the other but I cut it down to just one frame. The frame automatically resized and centered itself to the center of the screen.

Does any one know how to do this here?

dccawthon

11:13 am on Mar 19, 2006 (gmt 0)

10+ Year Member



Ok I found the code just in case any one wants this here it is.

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function resizeit(width, height){
var s_width = screen.width;
var s_height = screen.height;
window.parent.resizeTo(width,height);
window.parent.moveTo((s_width-width)/2,(s_height-height)/2);

}
//-->
</SCRIPT>
</HEAD>
<BODY onload="resizeit(470,700)">

</BODY>
</HTML>

The problem I'm having with this is I can't figure out how to make this code not show, toolbars, menubars, and the status bar.

If anyone can shed some light here, please please do.

kaled

11:46 am on Mar 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the context in which it is being called, this should do the same thing with less code.

function resizeit(w,h){resizeTo(w,h); moveTo((screen.width-w)/2,(screen.height-h)/2)}

The absence or presence of chrome (tool bar, status bar, etc.) is determined by the window.open() function. It can't be adjusted once the window has already been created.

Kaled.

dccawthon

7:25 am on Mar 20, 2006 (gmt 0)

10+ Year Member



Thank you for replying kaled.

I do have a page setup that calls this page and displays it in a frame. Would I be able to use the window open function with that?