JavaScript.CoolDev.Com Support Forums
Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com
| Author |
Message |
Wakey Guest
|
Posted: Thu Jun 26, 2003 8:05 pm Post subject: How do you add it to a page? |
|
|
I keep looking at the wording of the user documentation but it makes no sense  |
|
| Back to top |
|
 |
camner
Joined: 05 Jun 2003 Posts: 21
|
Posted: Thu Jun 26, 2003 8:51 pm Post subject: |
|
|
| It might be helpful if you would ask a more specific question so that people here can help you with what you are struggling with. |
|
| Back to top |
|
 |
Wakey Guest
|
Posted: Thu Jun 26, 2003 9:01 pm Post subject: |
|
|
I thought the title was pretty self explanitory, I've got the code for the menu, i used the online generator, how do i now get the menu onto a page.
It'll be an shtml page. |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Thu Jun 26, 2003 9:16 pm Post subject: |
|
|
| You'd better look at some sample, then use it as starting point. You can take some sample script setup from COOLjsMenu package, or you can ask technical support (jssupport@cooldev.com) to send you some other sample without spare code. |
|
| Back to top |
|
 |
Wakey Guest
|
Posted: Thu Jun 26, 2003 9:35 pm Post subject: |
|
|
ok, I've got the package so I'll have a look, the bit that's getting me is -
Adding to page
To add menu to you HTML page you need perform next steps:
Give unique name for you menu. For example: "MainMenu", "COOLjsMenuTheBest", etc.
Create menu definition in a separate file.
Include coolmenu.js and finle with menu definition to HEAD attribute of your HTML page.
For example:
<head>
<script language="JavaScript" src="js/coolmenu.js"></script>
<script language="JavaScript" src="menu_items.js"></script>
<link href="/css/coolmenu_styles.css" rel="stylesheet" type="text/css">
<head/>
Call COOLjsMenu constructor before </BODY> tag.
For example:
<script language="JavaScript"">
var menu = new COOLjsMenu("MainMenu", MENU_ITEMS);
</script>
</body>
Enjoy!  |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Thu Jun 26, 2003 9:49 pm Post subject: |
|
|
So, just follow the instructions.
1. Go to online builder and try to generate menu structure. E.g. builder's output was the following:
| Code: |
var BLANK_IMAGE="img/b.gif";
var CM_STYLE = {"border":1, "shadow":2, "color":{"border":"black", "shadow":"gray", "bgON":"silver","bgOVER":"navy"}, "css":{"ON":"clsCMOn", "OVER":"clsCMOver"}};
var code="code";var url="url";var sub="sub";
var MENU_ITEMS = [
{"pos":[5,5], "size":[25,100], "itemoff":[0,99], "leveloff":[24,0], "delay":600, "style":CM_STYLE},
{code:"1", url:"1"},
{code:"2", url:"2",
sub:[
{"size":[25,100],"itemoff":[24,0],"leveloff":[24,0],"style":CM_STYLE},
{code:"3", url:"3"}
]
}
]; |
Actually, this code was produced in several mouse clicks and keys '1', '2',and '3', and then I've added first line with BLANK_IMAGE definition (this definition needed because we are creating menu from scratch).
2. Paste this code into newly created .js file ("menuitems.js" is a good name for it).
3. Put menuitems.js and coolmenu.js into some folder, probably into the same folder where your HTML code is. Then link these files into your HTML code:
| Code: | <script language="JavaScript" src="coolmenu.js"></script>
<script language="JavaScript" src="menuitems.js"></script> |
Also, put somewhere blank image "b.gif" from the package, and adjust path of this image at the first line of menuitems.js.
4. Add initialization code to your HTML just before </BODY>:
| Code: | <script language="JavaScript"">
var menu = new COOLjsMenu("MainMenu", MENU_ITEMS);
</script>
</body> |
5. You'll probably want to create/adjust CSS definitions of classes clsCMOn and clsCMOver. |
|
| Back to top |
|
 |
Wakey Guest
|
Posted: Thu Jun 26, 2003 10:11 pm Post subject: |
|
|
cheers mate you're an absolute star
I recon you personally should re-write the read me installation bit, much clearer like that!
Although I'm probably just simple with all this  |
|
| Back to top |
|
 |
Wakey Guest
|
Posted: Thu Jun 26, 2003 10:17 pm Post subject: |
|
|
| Another thing, where it says coolJs menu underneath is this only visible because I use the online thing, if I'd've done it myself would this not be here? |
|
| Back to top |
|
 |
camner
Joined: 05 Jun 2003 Posts: 21
|
Posted: Fri Jun 27, 2003 3:17 am Post subject: |
|
|
That disappears when you register it!  |
|
| Back to top |
|
 |
Wakey Guest
|
Posted: Fri Jun 27, 2003 3:27 pm Post subject: |
|
|
ah right! fair enough!
One more question, I've been inserting it onto my page but for some reason when i preview the page, the menu's always at the top and won't stay where i position is?! |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Mon Jun 30, 2003 9:14 am Post subject: |
|
|
| How do you position the menu? If you are trying to put non-Pro version into some container, then this is incorrect because only Pro can be used like that. Standard edition can be positioned only absolutely, and its position is determined by "pos":[some_x,some_y] field in the menuitems.js. |
|
| Back to top |
|
 |
|
|