Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

HRef  window size

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
API works for 1 result, need to make it many 30 92
PDF Embed pdfobject.js local path problem regular ASP 2 176
Using Classic ASP inside HTML pages 2 62
Designing forms 3 17
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

861 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