Recent Questions Php Heirachial Tree Menu Mysql Prototype
Q: Can I use javascript to get the object (getElementByID). If not howdo I hide my dropdown menu on print?
A: You can add a new button to print your page and call onClick event, soyou should write:
<body ....
onClick="document.getElementById('dm0m0').style.visibility='hidden'; window.print();">
...
</body>
Or you can use the same javascript code from your menu item.
For example:
var menuItems = [
["Print", "javascript:document.getElementById('dm0m0').style.visibility='hidden';
window.print();", icon1, icon2],
];
But if you want to hide the menu when your customers push "File/Print"you should write so:
You must create two functions, for example:
function myprint()
{ document.getElementById('dm0m0').style.visibility='hidden';
window.print();
}
function myprint2()
{ document.getElementById('dm0m0').style.visibility='visible';
window.print();
}
You should add this functions into your code.
And then you must write so:
window.onbeforeprint = myprint;
window.onafterprint = myprint2;
Q: I've noticed something strange in the Javascript/DHTML Tree and I am wondering if this is normal.
Here's an example I have in my "data.js" file to populate the javascript ajax tree:
var tmenuItems = [
["Mes alertes/My alerts","", "", "", "", "", "", "0", "", "", ],
["|Francais","", "", "", "", "", "", "", "", "js/AjaxTreeFr.js", ],
["|English","", "", "", "", "", "", "", "", "js/AjaxTreeEn.js", ],
];
Here's basically how it goes:
- Basically the "0" represents a pre-built style that I have set for the root of my tree.
- Under this are the first child of the root called "Francais" and "English" which I link with a JS file to populate (Because the users will customize the alerts they want to see).
This works perfectly fine. But it is a workaround. Let me explain what I wanted in the first place:
var tmenuItems = [
["Mes alertes ","", "", "", "", "", "", "0", "", " js/AjaxTreeFr.js ", ],
["My alerts","", "", "", "", "", "", "", "", "js/AjaxTreeEn.js", ],
];
Basically I wanted to have 1 javascript ajax tree with 2 root items "Mes alertes" and "My alerts" but it seems impossible to attach a js file to the root of the tree view. (It doesn't get populated).
Any ideas?
A: See AJAX feature won't work for first-level in XP style now.
It works if you use:
var tXPStyle=0;Q: I just purchased your JavaScript Tree Menu maker. Wonderful tool!
I have made a menu, uploaded it to my HTML folder at Typepad in the correct place and tried several OTHER places too.
I have inserted the js snips into the head and body in all permutations of combinations.
I checked it each time by both opening my site and viewing source.
The menu is there. But it cannot be seen on the page. Never has been seen. Not even a hint of it being there.
I tried .js .file AND .js AND CSS.
No menu.
I checked on four browsers.
No menu.
I verified the files are in my index place by copying them to notebook.
I have done all of the above about 20 times EACH.
A: See, now you have:
<title>The Steel Deal - an oasis of reason in a sea of insanity.</title>
<!-- JavaScript Tree Menu -->
<noscript><a href="http://deluxe-menu.com">Javascript Menu by Deluxe-Menu.com</a></noscript>
<script type="text/javascript"> var dmWorkPath = "/";</script>
<script type="text/javascript" src="dmenu.js"></script>
<!-- (c) 2007, by Deluxe-Menu.com -->
....
<meta name="verify-v1" content="VP25uY4F2NriQQhn7R3wK4aeYoMZpbafF+kkwx+vze4=" />
<!-- JavaScript Tree Menu -->
<noscript><a href="http://deluxe-menu.com">Javascript Menu by Deluxe-Menu.com</a></noscript>
<script type="text/javascript"> var dmWorkPath = "/";</script>
<script type="text/javascript" src="/dmenu.js"></script>
<!-- (c) 2007, by Deluxe-Menu.com -->
</head>
It is not correct. You should call dmenu.js file only once.
Please, delete the second code.
There is now engine .js files
dmenu.js
dmenu4.js
dmenu_add.js
dmenu_dyn.js
dmenu_key.js
dmenu_cf.js
dmenu_popup.js
dmenu_ajax.js
and data file on your server.
Q: Deluxe Tunes says:- “Use "File/Export to HTML" to see how to write the code within html page.”
If I use this the generate the code it places the
But if I look at your website code it looks as if it should be placed within the <Body> </body> tags
Can you confirm where this should be placed? As we are seeing the dmlinks before the page is displayed.
A: You should paste search engine friendly code into the <body> tag.