How to specify global image directory?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
mfindlay
Super Advanced
Super Advanced
Posts: 38
Joined: Mon Jun 28, 2004 5:00 pm

How to specify global image directory?

Post by mfindlay »

Using Milonic 5.42 registered.

Is there a prooperty that can be set to indicate to the menu system a global directory where it will find all images? (i.e. submenu arrow images, etc) regardless of where the menu is used in the site?

Thanks!
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi,

The best way to do this is to use a variable that you pass to all images.

The variable is declared at the top of the data file and is re-used when you need to declare an image.

Here's a sample:

Code: Select all

var imgLocation="http://milonic.com/images/";

with(menuStyle=new mm_style()){
onbgcolor="#4F8EB6";
oncolor="#ffffff";
offbgcolor="#DCE9F0";
offcolor="#515151";
image=imgLocation+"image.gif";
subimage=imgLocation+"subimg.jpg";
}

with(milonic=new menuname("Main Menu")){
style=menuStyle;
alwaysvisible=1;
aI("text=Home;image="+imgLocation+"image1.gif;url=http://milonic.com/;");
aI("text=Home;image="+imgLocation+"image2.gif;url=http://milonic.com/;");
aI("text=Home;image="+imgLocation+"image3.gif;url=http://milonic.com/;");

}

Hope this helps
Andy
Post Reply