Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open new browser window from pop-up menu? 2

Status
Not open for further replies.

lizziebyrne

Technical User
Jul 7, 2003
19
GB
Hi there,

Can any one clear this up for me??
I'm trying to create a pop-up menu that opens a new browser window when you click the links.

So far I've created a pop-up menu in fireworks and exported the file to dreamweaver, where I've then searched through the code to find the best place to apply the open browser window code, but no joy.
 
When you create your pop-up menu in Fireworks, you have the option to specify the target for your link - simply select "_blank" for each one.

Alternatively, you can alter the Dreamweaver code thus :
Code:
<!--
function mmLoadMenus() {
  if (window.mm_menu_0405084055_0) return;
  window.mm_menu_0405084055_0 = new Menu("root",53,20,"Verdana, Arial, Helvetica, sans-serif",14,"#9999cc","#000099","#ffffff","#ffffff","left","middle",3,0,500,-5,7,true,false,true,0,true,true);
  mm_menu_0405084055_0.addMenuItem("Link&nbsp;1","window.open('link1.htm'[COLOR=red], '_blank'[/color]);");
  mm_menu_0405084055_0.addMenuItem("Link&nbsp;2","window.open('link2.htm'[COLOR=red], '_blank'[/color]);");
   mm_menu_0405084055_0.hideOnMouseOut=true;
   mm_menu_0405084055_0.menuBorder=1;
   mm_menu_0405084055_0.menuLiteBgColor='#ffffff';
   mm_menu_0405084055_0.menuBorderBgColor='#555555';
   mm_menu_0405084055_0.bgColor='#555555';

  mm_menu_0405084055_0.writeMenus();
} // mmLoadMenus()

//-->
</script>

You will find the above code within the <HEAD></HEAD> tags in your Dreamweaver page.
 
mattygriff has generously posted the solution....


*should u need "more control" over "poped-blank-new" windows then consider using:

in the some(parent).html page:
-click on your 'link'...Go to Behaviros--Open Browsers Window and fill in as specified
to create a pop-up.


Notice the code generated:
Code:
<a href="#" onClick="MM_openBrWindow('Pop.html','POP','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=300,height=300')">link</a>
this is generated by MM_ and should u need the combination of MM_menu and MM_openBrWindow then simply change the code:
into:
Code:
....mm_menu_0405084055_0.addMenuItem("Link&nbsp;1","window.open('Pop.html','POP','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=300,height=300')");

and combine it with matt's "menu" code snip.
If you dont care about the size and position of the "newly opened window" then matt's trick of "_blank" taget is More than sufficient!
All the best!

> need more info?
:: don't click HERE ::
 
Thanks for both your replies, yes I did want to specify the size of the browser window. I'll try out the code and see how I get on. Cheers once again! L
 
Thanks lebisol. I did need resizing. The # with the Open Browser window did the trick. AMc

Should I stay or should I go now? Thanks & Goodbye, Joe.
 
P.S. How would I vertically and horizontally center the new window in the browser using your example above? Thanks, AMc

Should I stay or should I go now? Thanks & Goodbye, Joe.
 
very easy:
-add the coordinates (that are with respect to sreen) after the code
'scrotllbars=yes,width=580,height=480,top=19,left=44')

All the best!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top