PDA

View Full Version : open text link in sized window


Mgkeeper
08-02-2002, 07:55 PM
I always see scripts to open button links in sized windows (you can put code in to have a certain width or height) But I need that for text links. Anybody have a code for text links???

boxer_1
08-02-2002, 08:21 PM
Sounds like you're talking about pop-up windows. There's a pop-up generator here that will make the code for you based on the attributes you specify ;).

http://javascriptkit.com/popwin/index.shtml

Is this what you were after?

Mgkeeper
08-02-2002, 08:32 PM
no, i just need to be able to define the width and height in a text link to a popup

boxer_1
08-02-2002, 08:42 PM
How about this?:

<a href="javascript:;" onClick="window.open('some_CSS3.html','myWin','scrollbars=yes,width=400,height=500');">Open Window</a>

Mgkeeper
08-02-2002, 08:54 PM
do you know how to put that into an imagemap??

boxer_1
08-03-2002, 06:57 PM
Originally posted by Mgkeeper
do you know how to put that into an imagemap??

Here's an example to show you how you can open a pop-up from an imagemap. Note the bolded parts. The first example shows how you can open a pop-up and link to another page. The other 3 just open a pop-up onClick:

<html>
<head>
<title>Imagemap Example</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" alink="ff0000" vlink="#800080">
<img src="img_for_map.gif" usemap="#img_for_map.gif" border="0">
<map name="img_for_map.gif">
<area shape="rect" coords="5,4,207,219" href="http://www.codingforums.com" target="_self" onClick="window.open('your.html','myWin','scrollbars=yes,width=400,height=500');">
<area shape="rect" coords="210,3,398,219" href="javascript:;" onClick="window.open('your.html','myWin','scrollbars=yes,width=400,height=500');">
<area shape="rect" coords="4,223,209,394" href="javascript:;" onClick="window.open('your.html','myWin','scrollbars=yes,width=400,height=500');">
<area shape="rect" coords="214,226,393,393" href="javascript:;" onClick="window.open('your.html','myWin','scrollbars=yes,width=400,height=500');">
</map>
</body>
</html>

For some reason the ');"> goes to another line, just bring bring them back to the line above them in your code ;).