JavaScript.CoolDev.Com Support Forums
Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com
| Author |
Message |
Jorge Guest
|
Posted: Tue Sep 30, 2003 1:07 pm Post subject: COOLjsMenu Pro, images, root menues and itemoff |
|
|
Hi, I'm remaking (http://www.fair.dk). The root menu is giving me problems.
I cannot get the second menu item to be positioned right against the first one, 'cause of the size of the first picture. What am i doing wrong? I cannot set every menu item by itself as the menus are generated by a CMS. (Such as: for every document in .... and then I do the {"code":'<img .... } for every document)
/ Jorge
function getWidth(imagePath) {
var imgW = new Image();
imgW.src = imagePath;
return imgW.width;
};
var MENU_ITEMS =
[
{"pos":"relative", "leveloff":[0,38], "itemoff":[0,38], "style":STYLE, "size":[19,38]},
{"code":'<img src="/images/topmenu/img8_off.gif">', "ocode":'<img src="/images/topmenu/img8_on.gif">', url:"/smcms/FORSIDE/Index.htm?ID=8", "format":{"leveloff":[0,getWidth("/images/topmenu/img8_on.gif")], "itemoff":[0,getWidth("/images/topmenu/img8_on.gif")], "size":[19,getWidth("/images/topmenu/img8_on.gif")]}},
{"code":'<img src="/images/topmenu/img5_off.gif">', "ocode":'<img src="/images/topmenu/img5_on.gif">', url:"/smcms/OM_FAIR/Index.htm?ID=5", "format":{"leveloff":[0,getWidth("/images/topmenu/img5_on.gif")], "itemoff":[0,getWidth("/images/topmenu/img5_on.gif")], "size":[19,getWidth("/images/topmenu/img5_on.gif")]}},
and so on.... |
|
| Back to top |
|
 |
Jorge Guest
|
Posted: Tue Sep 30, 2003 9:07 pm Post subject: Re: COOLjsMenu Pro, images, root menues and itemoff |
|
|
I solved it, but i dont like the solution:
I had to ask explicitly for the first document number (the one with the smaller picture) to set the leveloff and itemoff properties. Blah! but as the pictures are already mapped to an ID, then I suppose it's OK.
/ jorge |
|
| Back to top |
|
 |
|
|