Solved

HRef  window size

Posted on 2001-08-31
4
687 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now