Recent Questions Javascript Tree Dock Menu
Q: Is there a way we can add javascript behaviors to the popup menu in java actions? For example, is there a way we can add an onClick function to a popup menu in java item (eg, onClick="return MyFunction( )" ) so that we can catch and process key events?
I'm really hoping there's a way of doing this...
A: Unfortunately, you can't assign onmouseover/onClick/onContextMenu event to each item. However, you can achieve this by using standard html objects within popup menu in java items, for example:
var menuitems = [
["<div onContextMenu='your_code_here'>item text</div>", ""]
];
You can use your own Javascript code instead standard links. For example:
var menuItems = [
["text", "javascript:your_code_here"]
];
Q: I intend to purchase a copy of Deluxe menu where I will be using tree menu for a project. I have created the tree describing the menu and copied the data.Files folder, data.js file to the area where the HTML page is and pasted the relevant text into html file.
When opening the page, the tree menu in javascript is not displayed. Can you please help me resolve this problem. I have attached the data.files folder (in zipped form), the data.js file and the html page I am using
A: Now you have the following code on your html page:
<HTML>
<HEAD>
<script type="text/javascript" src="data.files/dtree.js"></script>
</HEAD>
<BODY>
</BODY>
</HTML>
It is not correct you should install the menu in the following way:
<HTML>
<HEAD>
<script type="text/javascript"> var tWorkPath="data.files/";</script>
<script type="text/javascript" src="data.files/dtree.js"></script>
</HEAD>
<BODY>
<script type="text/javascript" src="data.files/data.js"></script>
</BODY>
</HTML>
You can use "Export to HTML" function in Deluxe Tuner.
Q: I got it to work ... but I can't make the javascript menu bars locate where I want it on the page.
A: Check that you use relative position for the menu
var absolutePos=0;
var posX="0px";
var posY="0px";
You can install the menu in DIV or Table, for example:
<div align=center>
<script type="text/javascript" src="deluxe-menu/data.js"></script>
</div>
You can send us a copy of your html page (including .js files) ora direct link to your website, so we can check it.
Q: Drop Down Menu could be the best solution for my website ... but Ihave one important question: I've seen, that it's possible to open the javascript change menu linked contents in the same or in a new window or in a frame ... but is it possible, too, to generate a new tab? To open a new window often is not possible, because most users have popup-blockers installed. And to open the contents in the same window drives the user away from the main page! Open a new tab seems to be less risky ... is there any solution to be used with Drop Down Menu? I tried to use "_tab" instead of "_self" or "_parent", but it did not work!
A: You should use _blank. If your browser supports tabs your link will beopened in a new tab (except IE, in IE it will be opened in a newwindow).