Solved

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

Posted on 2004-09-10
7
165 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
Comment Utility
0
 
LVL 7

Expert Comment

by:jay_eire
Comment Utility
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
Comment Utility

<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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 10

Expert Comment

by:rockmansattic
Comment Utility

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
Comment Utility
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
Comment Utility

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
Comment Utility
ah yes, i see now.

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

:)

cheers again

mat
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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 …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

18 Experts available now in Live!

Get 1:1 Help Now