Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New window opening with fixed size. 1

Status
Not open for further replies.

Eldaria

Programmer
Sep 20, 2001
123
NL
Hi guys,

How can i make a link, so that when the user click on it, it will open a new window, but the new window should have a fixed sixe, and no toolbars, addressbar, etc...

I want to use it on a site where a user can click on an item to get more information, and this should then open ain a new window.

Regards.
Brian


Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
keepingbusy: didn't you know that "heght" neans "height" in Russian? :)
OK, to center(e) the window we'll need to do some math(assuming that we want the pop-up's dimentions to be w:600px h:400px):

<script language=&quot;JavaScript&quot;>
function openNewWindow(occId){
var path = path + &quot;?occId=&quot; + occId;
var iLeft = screen.height/2 - 200;
var iTop = screen.width/2 - 300;

var prefs = &quot;toolbars=0,scrollbars=0,menubar=0,status=0,resizable=1,width=600px,height=400px,left=&quot; + iLeft + &quot;,top=&quot; + iTop;

window.open(path, &quot;&quot;, prefs);
}
</script>

<a href=&quot;javascript:eek:penNewWindow();&quot;>Open New window</a>

If you wnat to change pop-up window dimentions, you'll need to change the substracted numbers as well.
 
Sorry, it's been a long day: please read the code as follows:

<script language=&quot;JavaScript&quot;>
function openNewWindow(){
var path = &quot;somepage.asp&quot;;
var iLeft = screen.height/2 - 200;
var iTop = screen.width/2 - 300;

var prefs = &quot;toolbars=0,scrollbars=0,menubar=0,status=0,resizable=1,width=600px,height=400px,left=&quot; + iLeft + &quot;,top=&quot; + iTop;

window.open(path, &quot;&quot;, prefs);
}
</script>

<a href=&quot;javascript:eek:penNewWindow();&quot;>Open New window</a>


 
Hi LV

I had no idea!! &quot;keepingbusy: didn't you know that &quot;heght&quot; neans &quot;height&quot; in Russian? :)&quot;

&quot;Many thanks for your help my friend&quot;
&quot;Beaucoup remercient pour votre aide mon ami&quot; - French
&quot;Muchos agradecen para su ayuda mi amigo&quot; - Spanish
&quot;Viele Dank für Ihre Hilfe mein Freund&quot; - German

What a great forum this is....
Take care and thanks again
KB in the UK

When everything else is said and done, there will be nothing else to say or do
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top