PDA

View Full Version : how to create a link to open up in new window


shynomi
09-27-2005, 07:35 AM
hey everyone i'm new here! i'm working on a site and i'm needing to have one of the links on the page open up in a new (fixed) window but i can't figure out how...the main thing is it needs to be a certain size. the picture i'm using as the bg is 600x500 so how do i create a link that'll open into a page that size?

example: http://www.babalonband.com/ ('http://www.babalonband.com/')
-click on enter and it opens up in a new (fixed) window.

i usually do all the layouts in photoshop then slice the images and bring them into DWMX.

thanks in advance guys!!!
nate

davidj
09-27-2005, 08:07 AM
this is a popup window you can use

place inside above the </head> tag


<script language="JavaScript">
<!--
//tmtC_winOpen
var newWin;
//tmtC_winOpenEnd

function tmt_winOpen(u,id,f,df){
if(eval(id)==null||eval(id+".closed")){
eval(id+"=window.open('"+u+"','"+id+"','"+f+"')"); eval(id+".focus()");}
else if(df){eval(id+".focus()");}
else{eval(id+"=window.open('"+u+"','"+id+"','"+f+" ')");eval(id+".focus()");}
}
//-->
</script>




now place this where you want to click

<a href="#" onclick="tmt_winOpen('page4.html','newWin','width= 600,height=500,left=0,top=0,toolbar=yes,
menubar=yes,location=yes,scrollbars=yes,status=yes ,resizable=yes,
directories=yes,copyhistory=yes',1)">new window</a>


note the variables


'width=600,height=500,left=0,top=0,toolbar=yes,men ubar=yes,
location=yes,scrollbars=yes,status=yes,resizable=y es,
directories=yes,copyhistory=yes'


change the values to what you want
e.g.. toolbar=no will turn off the toolbars

there are loads of ways to do this ( i have this as a snippet in DW)

ranjan
09-27-2005, 08:43 AM
The javascript provided by davidj is old and outdated. So is the default open browser behavior in dreamweaver. This kind of scripting would have worked in the days when browsers did not block pop up windows by default {firefox and opera and IE too (in cases with msn toolbar installed) block this kind of script}

My suggestion is to look get this ('http://www.flevooware.nl/dreamweaver/extdetails.asp?extID=8') extension instead of using the above script!

davidj
09-27-2005, 09:45 AM
The javascript provided by davidj is old and outdated.

thats just how i feel! ;)

shynomi
09-27-2005, 03:36 PM
ok i'll try the extension, thanks so much to both of you!
nate

Marlin
10-04-2005, 02:23 AM
hey everyone i'm new here! i'm working on a site and i'm needing to have one of the links on the page open up in a new (fixed) window but i can't figure out how...the main thing is it needs to be a certain size. the picture i'm using as the bg is 600x500 so how do i create a link that'll open into a page that size?

example: http://www.babalonband.com/ ('http://www.babalonband.com/')
-click on enter and it opens up in a new (fixed) window.

i usually do all the layouts in photoshop then slice the images and bring them into DWMX.

thanks in advance guys!!!
nate
To create a neatly sized "new window" in DMX, one that functions like a popup and contains a table or graphic of a particular size, first create a page for the object and insert the image or create the table using pixels as opposed to percentages. Use <Modify> <Page Properties> and make sure to set all margins at zero. That'll keep the "popup" clean. Save that file for reference from the page you intend to launch it.

Open the launching page that'll contain the link for that purpose. Click to select it, i.e., the link that will open the new window. Make sure you have the <Window> <Behavior> module selected and display. You should see it on the left of the screen.

Select the Plus (+) sign under Behaviors, then select "Open Browser Window." Browse to the file/page that contains the info you want to display in the new window. Select it and click Okay. In the resulting parameters dialogue set the page size (width and height) exactly the same size as the graphic. In the <Attributes> I usually select [only] the option to resize the window. (That allows a curious user to double click the title bar and open the page to full size.) Be sure you've selected the appropriate trigger, which would normally be an <OnClick>, which means a left click. To make that selection, click on the highlighted area beside the area that denotes the function, <Open Browser Window>, and one click will display the little arrow that shows you a drop down menu. From there you can select from a variety of triggers. NOTE that you'll have to have the link selected in your main launching document.

Now you can upload both files and whatever associated graphic to the host servers. I don't think I left anything out.

A caveat: If you want to display a picture and feel it necessary to embed it in the launched document as a background image, that's fine if you intend to place text over it, thereby using the background for asthetics. Otherwise you can tie a closing trigger to a page-bound image and a mere click on the image, flagged as such by using Alt Text with the image, will close the new window.

Tell you what. In order to better explain what I'm talking about I'll hop my untility scheme onto my web site like so:

Close Window ('http://www.lodebar.org/close_window.htm')

What I do, is load the page containing the Close Button graphic from my Utilities folder. A double click and a quick browse to the graphic you actually want to use, and upon a double click, you'll have replaced the <Close> button graphic with the one you want to display. Just be sure and attach the appropriate Alt Text informing the user to "Click Image To Close Window>. And, of course, save the HTML document as the file/image to be launched from the launching page's link.

If you use a graphic to launch the new window you can insert a pound sign (#) in the Properties Dialogue's <Link> attribute in order that a action hand will appear when the graphic is moused-over. Also, I'm thinking that you may need to do the same thing with highlighted text, should you be using that as the link. Otherwise the Behaviors options might not be functional. So highlight the text for the link, insert the #, then re-select the now active link, then go on with the process of referencing the Behaviors dialogue.

Lemme know how you make out. Also, here are a couple of web sites that may demonstrate how it's supposed to work:

http://www.blind-cat.com/ ('http://www.blind-cat.com/')

http://www.emlbr.com/ ('http://www.emlbr.com/')

As for the page about the Close Window, copy it from my web site if you like, or open the coding and copy the text from notepad to the Window's clipboard.

Regards,
-Marlin