JavaScript.CoolDev.Com Support Forums
Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com
| Author |
Message |
kaltarrant
Joined: 03 Aug 2005 Posts: 3
|
Posted: Wed Aug 03, 2005 8:34 pm Post subject: Resize doesn't wrap menu |
|
|
I want the coolmenupro to wrap when I resize my browser to small. Is this possible?
If you look at http://www.mikewelsh.net, you'll see that if you resize the browser to the left (smaller) so that the coolmenu is off to the right of the screen -- is there a way to make the coolmenu wrap??
I'm using version 2.4.1.
thanks!
-Mike |
|
| Back to top |
|
 |
Victor_Chuiko Support Team
Joined: 12 Apr 2005 Posts: 145
|
Posted: Thu Aug 04, 2005 8:53 pm Post subject: |
|
|
You can do it in such a way:
| Code: | var MENU_ITEMS = [
{pos:[0,0], itemoff:[0,'+0.333body-1px'], leveloff:[21,0], style:STYLE, |
0.333 must pe replaced with 1/n, where n = number of top-level elements. |
|
| Back to top |
|
 |
kaltarrant
Joined: 03 Aug 2005 Posts: 3
|
Posted: Thu Aug 04, 2005 9:07 pm Post subject: Hmm..no effect |
|
|
That didn't make any difference. If I'm using relative, will that still work?
I have 7 items in my menubar so I replaced .333 with .143.
The code is here:
<code>
function ADDSID(url)
{
if (jsSID == "") return url;
var index = url.indexOf("?");
if (index == -1)
return url + jsSID;
return url.substring(0,index) + jsSID + "&" + url.substring(index+1);
}
var __widths = 82;
var __height = 24;
//keywords
var code="code";var url="url";var sub="sub";
//styles
var defcolor = {"border":"#000000", "shadow":"#000000", "bgON":"#0099CC","bgOVER":"#00CCCC"};
var defcss = {"ON":"clsCMTopOn", "OVER":"clsCMTopOver"};
var itemcss = {"ON":"clsCMOn", "OVER":"clsCMOver"};
var headcss = {"ON":"clsCMOnHead", "OVER":"clsCMOverHead"};
var TOP_MIDDLE = {"border":1, "borders":[1,0,0,0], "shadow":0, "color":defcolor, "css":defcss};
var STYLE1 = {"border":1, "borders":[1,0,1,0], "shadow":2, "color":defcolor, "css":defcss};
var STYLE_TOP = {"border":1, "borders":[1,1,1,0], "shadow":3, "color":defcolor, "css":itemcss};
var MENU_ITEMS = [
{"pos":[166,97], "size":[__height,100], itemoff:[0,'+0.143body-1px'], "leveloff":[0,0], "delay":600, "style":TOP_MIDDLE},
{code:"Home", url:ADDSID("/index.php"), "format":{"size":[__height,__widths], "arrow":null, "image":null, "style":TOP_MIDDLE}
},
{code:"Services", url:ADDSID("/services.php"), "format":{"itemoff":[0,__widths-10], "size":[__height, __widths], "arrow":null, "image":null, "style":TOP_MIDDLE}
},
{code:"References", url:ADDSID("/references.php"), "format":{"size":[__height,__widths], "itemoff":[0,__widths], "arrow":null, "image":null, "style":TOP_MIDDLE}
},
{code:"Rates", url:ADDSID("/rates.php"), "format":{"size":[__height,__widths+10], "itemoff":[0,__widths], "arrow":null, "image":null, "style":TOP_MIDDLE}
},
{code:"Downloads", url:ADDSID("/downloads.php"), "format":{"itemoff":[0,__widths+10], "size":[__height, __widths], "arrow":null, "image":null, "style":TOP_MIDDLE}},
{code:"Contact", url:ADDSID("/contact.php"), "format":{"itemoff":[0,__widths], "size":[__height, __widths], "arrow":null, "image":null, "style":TOP_MIDDLE}},
{code:"Donate", url:ADDSID("/donate.php"), "format":{"itemoff":[0,__widths], "arrow":null, "image":null, "style":TOP_MIDDLE}}
];
//override default blank image ('img/b.gif')
BLANK_IMAGE = '/jsMenu/img/blank.gif';
</code>
thanks,
-Mike |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Fri Aug 05, 2005 9:34 am Post subject: |
|
|
'+0.333body' mode can work like this: your menu will span across the window, and when sombody resizes window menu will also resize to fit new width. Looks like this is not what you wanted to achieve.
We have no ready feature that could do the trick, but if you want you can order it at javascript@cooldev.com.
The sample above doesn't work because "size:[...]" also must be changed:
| Code: | var MENU_ITEMS = [
{"pos":[166,97], "size":[__height,'+0.143body'], itemoff:[0,'+0.143body-1px'], "leveloff":[0,0], "delay":600, "style":TOP_MIDDLE}, |
|
|
| Back to top |
|
 |
|
|