Recent Questions Javascript Menu Dtree
Q: Once more I have a small question about JavaScript Tree Menu.
I have rewritten my homepage (still off-line) to use stylesheets instead of frames. But for some reason the drop down menu templates won't appear anymore.
Does DM need frames or can it also work without frames? I would suppose that it can also work on a page with no frames. But for some reason I can't seem to get it to work.
A: If you don't use frames there is no need to write your init functionin the following way:
dm_initFrame("lower", 0, 1, 1);
That is way you cannot see your menu.
Please, write:
dm_init();
Q: I love the new pop windows. That is something I need right now. I am having a problem trying to figure out how to generate a link to window open html. I looked at what you have on your site but it is not clear to me.
A: You can show the popup window when you hover, click or mouseout on some elements on yourpage. For example you've added an image in your html page. You should specify the ID for it, for example:
<p><img id="open_popup" border="0" src="images/submenu-bg.gif" width="170" height="29"></p>
In the Deluxe Tuner you should enter 'open_popup' object ID in the onMouseOver,onClick or onMouseOut fields.
Actually you can assign id to any object on your page manually. You should specify ID's - id="xxxx"for <a>, <div>, <img> ... tags.
Or you want to open a popup onMouseover, onClick or onMouseout on a link.
So, you should create a link (you can also use other object) on your page and set id="" for it, forexample:
<a href="javascript:;" id="link">Open popup OnClick</a>
<a href="javascript:;" id="over">Open popup OnMouseover</a>
<a href="javascript:;" id="out">Open popup OnMouseOut</a>
In Deluxe Tuner you should set:
onMouseOver - over
onMouseOut - out
onClick - link
If you want to show the window open html when your page loads you should leave these fields empty:
onMouseOver:"",
onMouseOut:"",
onClick:"",
Q: The menu has a problem with newlines. The menu builds correctly (layout ok) but when pressed on the button nothing happens
At some point, in the DHTML menu, we have the following in the javascript:
var menuitems = [
["|Print HTML","javascript:alert('HTML print: Only the 7 most recent orders on the screen \n will be printed because of space limitations on paper.');printResult('4'); ","","", ,"_parent",,] ]
As you can see we have a newline (\n) between the words "screen" and "will". But when we click on the button nothing happens. If we remove the newline and we click on the button then we first get the alert box. After pressing the OK button the function printResult is called.
Is there any way for us to still use the newline character in the menuItems variable?
This can be easily reproducible. That's why I haven't made an example.
A: Try to write in the following way \\n:
["|Print HTML","javascript:alert('HTML print: Only the 7 most recent orders on the screen \\n will be printed because of space limitations on paper.');printResult('4'); ","","", ,"_parent",,]
Q: Is there a way to get text to wrap on a tree menu rather then have scroll bars if the text is wider then the area?
A: To wrap your text you can use the following parameter:
var tnoWrap=0;
you can also use standard <br> tags.
["|Home aaaa aaaaaa aaaaaa<br>aaa aaaaaaaaaaa","testlink.htm", "default.files/icon1_s.gif", "default.files/icon1_so.gif", "", "Home Page Tip", "", "", "", ],