Recent Questions Jscript Jstree
Q: I still do not understand your answer about the simple java menu arrows, which work in preview, but not on the website. The html is correct.
A: You have
var arrowImageMain=["ss.files/arrow_sub5.gif","ss.files/arrow_sub5.gif"];
in your data js, so the arrows must be here
http://domain/ss.files/arrow_sub5.gif
you arrows is here
http://domain/menu/ss.files/arrow_sub5.gif
You can use
var pathPrefix_img="menu/";
or change paths here
var arrowImageMain=["ss.files/arrow_sub5.gif","ss.files/arrow_sub5.gif"]; --> menu/ss.files/arrow_sub5.gif
Q: I am trying to have the selected top menu w dhtml item remain on the mouseover event after it is selected. It seemed to be working fine when i was just testing with # as a link but when i actually linked to different pages it returns to normal. How do i get this to work.
I tried removing the variable from the data file and calling it using
<script type="text/javascript" language="JavaScript1.2"> var pressedItem=set 1,2,3 depending on page </script>
but this does not seem to work as it does for tabs.
A: You can find more info here:
http://www.deluxe-menu.com/highlighted-items-sample.html
JavaScript Tree Menu has only two states normal and mouseover.
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">menu w dhtml 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.
Q: Is it possible to place the icons on the right side of the menu items for the navigation bar script?
A: Unfortunately there is no such option. But you can use html code inside item's text, forexample:
["Purchase <img src='default.files/icon1.gif'>","http://deluxe-menu.com/order-purchase.html", "", "", "", "_blank", "", "", "", "", "", ],
Q: How do assign my own onclick events to menu options for the dhtml menubar?
I want do more than just redirect to an href.
A: Actually you can use your own Javascript code instead standard links.
For example:
var menuItems = [
["text", "javascript:your_code_here"]
];
or
var menuitems = [
["<div onClick='your_code_here'>item text</div>", ""]
];