Recent Questions Tree Menu Sample Code For Dreamweaver
Q: How change the color of the link in the dhtml vertical menu if the link is already visited.
A: JavaScript Tree Menu has only two states normal and mouseover,
butyou can highlight menu items in two ways:
Try to do the following things:
- delete var pressedItem=1; parameter from your data file
- set correct parameter on each page before you call data file, forexample:
<noscript><a href="http://deluxe-menu.com">Javascript Menu by Deluxe-Menu.com</a></noscript>
<script type="text/javascript"> var dmWorkPath = "menudir/";</script>
<script type="text/javascript" src="menudir/dmenu.js"></script>
<script type="text/javascript"< var pressedItem=3;</script>
...<script type="text/javascript" src="menudir/data.js"></script>
You can also set a pressed item using Javascript API:
function dm_ext_setPressedItem (menuInd, submenuInd, itemInd, recursion)
Sets a current pressed item.
menuInd - index of a menu on a page, >= 0.
submenuInd - index of a submenu, >= 0.
itemInd - index of an item, >=0.
recursion = true/false - highlight parent items.
But notice, to use dm_ext_setPressedItem() you should know ID of selected item and subitem.
You can't get this ID after you reload your page. That is why you should write your own code on PHP.
You can find more info here:
http://www.deluxe-menu.com/highlighted-items-sample.html
Q: How does one go about changing the parameter or the JavaScript so that a vertical menu selection stays 'on'? In other words, the vertical menu remains selected, perhaps in a background color that shows the user this menu choice is selected and the user is in the selected menu area.
A: To save your navigation path you should set the following parameter:
var saveNavigationPath = 1;
The menu keeps items highlighted during menu navigation.
0 - disabled, 1 - enabled (default).
You can highlight menu items by default in two ways:
1) Set the pressed item on each page idividually using the following parameter:
var pressedItem = -2;
The toggle mode. Sets an index of an item that will be highlighted by default.
-2 - the toggle mode is disabled;
-1 - the toggle mode is enabled, but no items highlighted by default;
0,1,2,3,... - index of highlighted item in a top-level menu.
- delete var pressedItem=1; parameter from your data file
- set correct parameter on each page before you call data file, for example:
<noscript><a href="http://deluxe-menu.com">Javascript Menu by Deluxe-Menu.com</a></noscript>
<script type="text/javascript"> var dmWorkPath = "menudir/";</script>
<script type="text/javascript" src="menudir/dmenu.js"></script>
<script type="text/javascript"> var pressedItem=2;</script>
...
<script type="text/javascript" src="menudir/data.js"></script>
2) Set the pressed item/subitem using dm_ext_setPressedItem () function.
Please see more info here:
http://deluxe-menu.com/highlighted-items-sample.html
Q: Can I install the menu using my buttons? I might be able to do it if the buttons used only one image, but they use two images. One is light and the other dark.
I also have some questions:
1) Will the menu stay in view when the user scrolls down?
2) I'm not even sure I care if the menu stays in view, because I believe that is done using php and is not good for SEO. The file that the search engines see is index.html while the file that visitors see is home.php. I think it would be better for SEO to have a normal .html page. Are you able to do that?
A: See how you should make image-based menus: if item text is empty, icon fields will be used as item images.
For example:
["", "index.html", "menu1a.gif", "menu1b.gif", "Home Page"]
1) You should use floatable feature.
See the following parameter:
var floatable=1;
2) You can generate search engine friendly code using Deluxe Tuner:
"Tools/Generate SE-friendly Code".
Q: Microsoft Explorer has settings that block JAVA scripts (and therefore our JAVA menu).
However, I notice that some JAVA menus on other web sites are not blocked by Microsoft Explorer.
Is there any way to make the java cascading menu not be blocked by Microsoft Explorer ?
I want people visiting my web site not to have the java cascading menu blocked by Mircrosot Explorer.
A: There is no way to enable these preferences automatically, in othercase there are no reasons to create security preferences.
But you can try to use a workaround:http://www.adobe.com/devnet/activecontent/articles/devletter.htmlTry to use AC_RunActiveContent.js file to run active content.