Solved

HRef  window size

Posted on 2001-08-31
4
689 Views
Last Modified: 2008-01-09
is there a way to control the size of the window opened by an <a href> ?
0
Comment
Question by:trekkee
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
thunderchicken earned 40 total points
ID: 6445053
Easy Easy

Here's a good tutorial:

http://www.zdnet.com/devhead/stories/articles/0,4413,2139716,00.html

Here's the sample from that page:

<FORM><input type="button" Value="Open Sesame!"
ONCLICK="window.open('http://www.zdnet.com/devhead/static/javascript/
windowsize/buttonwindow.html', 'groovywindow',
'toolbar=no,location=no,directories=no,status=no,
menubar=no,scrollbars=yes,resizable=no,copyhistory=no,
width=100,height=350')"></FORM>
0
 
LVL 11

Expert Comment

by:thunderchicken
ID: 6445057
Here's the code from that page you want with a direct hyperlink

<A HREF="index.html"
ONCLICK="window.open('iamwindowhearmeroar.html',
'popup', 'toolbar=no,location=no,directories=no,
status=no,menubar=no,scrollbars=no,resizable=no,
copyhistory=no,width=300,height=150')">Click me.</A>
0
 
LVL 12

Expert Comment

by:Preece
ID: 6445344
listening...

Preece
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 6445545
Yup!  Use this javascript function;

<script language="javascript">
if (window.screen) {
    var aw = screen.availWidth;
    var ah = screen.availHeight;
     aw = aw - 10;
     ah = ah - 25;
    }

var  mypopup=null
function popup(URL) {
     
     if ( mypopup && !mypopup.closed )
          { mypeopleup.close();
          }
mypopup = window.open(URL,"phone", 'scrollbars=1,menubar=0,resizable=1,background=white,toolbar=0,status=0,top=0,left=0,screenX=0,screenY=0,height=' + ah + ',width=' + aw);
}
</script>


It gets called like this;

<a href="javascript:popup('page.asp')">Click</a>
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
toggle checkboxes when a checkbox is checked 16 55
How to hide jquery hemiintro in returning user? 1 74
Select distinct 25 102
JQuery to parse xml string and get element by id 4 35
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 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