Solved

Making a pop up window appear when a link is clicked...

Posted on 2004-09-10
7
169 Views
Last Modified: 2010-04-25
Hi, im using Dreamweaver MX and im needing a specific sized window to appear when a link is clicked on on the main site page...

i need the window to be 400X600 in size and preferably be centered...

hope someone can help1

cheers
0
Comment
Question by:mhaysom123
  • 3
  • 2
  • 2
7 Comments
 
LVL 10

Accepted Solution

by:
rockmansattic earned 50 total points
ID: 12027547
0
 
LVL 7

Expert Comment

by:jay_eire
ID: 12027783
In the
design tab,
click on behaviors...
then click on Open Browser Window....
just fill in the options in this box and it will put the code into your dreamweaver page.
0
 
LVL 7

Expert Comment

by:jay_eire
ID: 12027818

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body>
 <a href="#" onClick="MM_openBrWindow('test2.html','mypopupwindow','width=400,height=600')">my link
 </a>
</body>
</html>

0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 10

Expert Comment

by:rockmansattic
ID: 12027858

This will not be centered, nor will he be able to control the atributes.


<quote>
i need the window to be 400X600 in size and preferably be centered...
</quote>


Rockman
0
 

Author Comment

by:mhaysom123
ID: 12029058
hi i tried to have a go with the link you entered rockmansattic but i had little luck, probably my fault as im not too good with java. I had a look in the dreamweaver help section and it says

''Use the Open Browser Window action to open a URL in a new window. You can specify the properties of the new window, including its size, attributes (whether it is resizable, has a menu bar, and so on), and name. For example, you can use this behavior to open a larger image in a separate window when the visitor clicks a thumbnail image; with this behavior, you can make the new window the exact size of the image''

this seems to be what i need as im not too fussed if it isnt centered, but the only thing is, i need the window to open up on a text link, but i can only use this behaviour on images etc...?

is there a way of making the behaviours work on text?

if not i will have to make images of all my text, which would be a lot, and that would then take alot of time etc..

hope someone can shed some light

cheers

mat
0
 
LVL 10

Expert Comment

by:rockmansattic
ID: 12029348

Yes, you can use an onclick command for text

But the link I sent you should work best,

Just follow the directions in the script....copy and paste the head content then copy the link.

Let me know i fyou have any other problems.

Here is the overall page using the like I suggested

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//  End -->
</script>
</head>

<body alink="#CC3333">
<a href="http://www.yahoo.com/" onclick="NewWindow(this.href,'name','400','600','yes');return false;">Popup Yahoo.com</a>
</body>
</html>

Rockman



0
 

Author Comment

by:mhaysom123
ID: 12029685
ah yes, i see now.

thanks, i think i was copying too much last time..

:)

cheers again

mat
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

789 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