Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

onclick open window and specific size

I have a link like this:

<a href="/index2.php?option=com_jumi&amp;fileid=3&amp;Itemid=11" onclick="window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,') 

I want the new opening window to open in a specific size. How do I specify the height and width?

like image 771
Alex Gordon Avatar asked Jan 28 '10 19:01

Alex Gordon


People also ask

How do I change the size of a popup window in HTML?

In HTML Executable, you can define several properties for pop-up windows: go to Application Settings => Pop-Ups. You may define the default size for new pop-up windows: enter the desired width and height in the different fields.


1 Answers

<a href="/index2.php?option=com_jumi&amp;fileid=3&amp;Itemid=11"    onclick="window.open(this.href,'targetWindow',                                    `toolbar=no,                                     location=no,                                     status=no,                                     menubar=no,                                     scrollbars=yes,                                     resizable=yes,                                     width=SomeSize,                                     height=SomeSize`);  return false;">Popup link</a> 

Where width and height are pixels without units (width=400 not width=400px).

In most browsers it will not work if it is not written without line breaks, once the variables are setup have everything in one line:

<a href="/index2.php?option=com_jumi&amp;fileid=3&amp;Itemid=11" onclick="window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=SomeSize,height=SomeSize'); return false;">Popup link</a>  
like image 142
Larry Hipp Avatar answered Sep 20 '22 22:09

Larry Hipp