Opening application in new window through menu link.

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
scargin
Super Advanced
Super Advanced
Posts: 36
Joined: Thu May 22, 2003 1:18 am
Location: Melbourne, Australia

Opening application in new window through menu link.

Post by scargin »

I am not quite sure what is the best method for opening an external application through a link.

The application is usually opened by a link and javascript include file:

<script language="JavaScript" type="text/JavaScript" src="http://d8199.i44.quadrahosting.com.au/F ... /script><a href="#" onclick="javascript:xlaAFMlaunch();">FAQ</a>

I have tried to use the ClickFunction property but I am not quite sure how to format it.

I have added <script language="JavaScript" type="text/JavaScript" src="http://d8199.i44.quadrahosting.com.au/F ... "></script> below the body tag and made the following changes to the main menu:

<script>
with(milonic=new menuname("Main Menu")){
style=MainmenuStyle;
alwaysvisible=1;
orientation="horizontal";
position="relative";
itemwidth="100%";
aI("image=Images/misc/Menu_dot.gif;overimage=Images/misc/Menu_dot_over.gif;text=home;url=default.asp;status=Back To Home Page;");
aI("image=Images/misc/Menu_dot.gif;overimage=Images/misc/Menu_dot_over.gif;text=about&nbsp;us;showmenu=about;");
aI("image=Images/misc/Menu_dot.gif;overimage=Images/misc/Menu_dot_over.gif;text=news&nbsp;&&nbsp;events;showmenu=news;");
aI("image=Images/misc/Menu_dot.gif;overimage=Images/misc/Menu_dot_over.gif;text=products;showmenu=products;");
aI("image=Images/misc/Menu_dot.gif;overimage=Images/misc/Menu_dot_over.gif;text=services;showmenu=services;");
aI("image=Images/misc/Menu_dot.gif;overimage=Images/misc/Menu_dot_over.gif;text=faq;clickfunction=yourfunction('javascript:xlaAFMlaunch();');status=FAQ;");
aI("image=Images/misc/Menu_dot.gif;overimage=Images/misc/Menu_dot_over.gif;text=links;url=links.asp;status=links;");
aI("image=Images/misc/Menu_dot.gif;overimage=Images/misc/Menu_dot_over.gif;text=contact&nbsp;us;url=content/anmviewer.asp?a=11&z=2;status=contact us;");
}
drawMenus();

</script>

My Javascript knowledge is a quite limited and I am not sure what I am doing wrong.

To see what I am hoping to do click the "Browse FAQ" link on the home page:

http://d8199.i44.quadrahosting.com.au/

Thanks in advance,

Stuart
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

image and overimage can go once in your global style 'MainmenuStyle' if they are all the same.

image="/Images/misc/Menu_dot.gif";
overimage="/Images/misc/Menu_dot_over.gif";

Code: Select all

with(milonic=new menuname("Main Menu")){ 
style=MainmenuStyle; 
alwaysvisible=1; 
orientation="horizontal"; 
position="relative"; 
itemwidth="100%";
aI("text=about&nbsp;us;showmenu=about;"); 
aI("text=news&nbsp;&&nbsp;events;showmenu=news;"); 
aI("text=products;showmenu=products;"); 
aI("text=services;showmenu=services;"); 
aI("text=faq;status=FAQ;");
aI("text=links;url=links.asp;status=links;"); 
aI("text=contact&nbsp;us;url=/content/anmviewer.asp?a=11&z=2;status=contact us;");
}

I took this out of faq because its wrong:
clickfunction=yourfunction('javascript:xlaAFMlaunch();');

But I don't know what it should be.

maz
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Stuart,

Try like this:

Code: Select all

aI("text=faq;url=javascript:xlaAFMlaunch();status=FAQ;"); 
Or like this:

Code: Select all

aI("text=faq;clickfunction=xlaAFMlaunch();status=FAQ;"); 
Either should work. (Note, I removed the image settings in these examples, to save space and also because, as Maz pointed out, they could be moved into the style since they're the same for each menu item)

Hope that helps,

Kevin
scargin
Super Advanced
Super Advanced
Posts: 36
Joined: Thu May 22, 2003 1:18 am
Location: Melbourne, Australia

Post by scargin »

Sorry about the delay in getting back to you. The forum was not accepting my username and password a few days ago. I generated a new password and it still was not working. Everything appears back to normal now.

Anyway your suggestion worked perfectly.

Thanks again for all your help,

Stuart
Post Reply