Recent Questions Javascript Save Tree Menu Itme
Q: Can I use my own images as the tabs in a div tab menu?
A: The Drop down menu items have the following structure:
var menuItems = [
[text, link, iconNormal, iconOver, tip, target, itemStyleInd, submenuStyleInd, jsFilename],
[text, link, iconNormal, iconOver, tip, target, itemStyleInd, submenuStyleInd, jsFilename],
...
];
Where iconNormal, iconOver - Icons of an item: icon in normal state, icon in mouseover state.
So you can set your menu items in a such way:
var menuItems = [
["","testlink.htm", "icon1.gif", "icon1o.gif"],
["","", "icon2.gif", "icon2o.gif"],
["|","testlink.htm", "icon3.gif", "icon3o.gif"],
["|","testlink.htm", "icon4.gif", "icon4o.gif"],
["|","testlink.htm", "icon5.gif", "icon5o.gif"],
["","testlink.htm", "icon1.gif", "icon1o.gif"],
];
Q: The problem that I am still experiencing (Im sure I have missed something obvious!) - is that all the pages open when you click on the relevant links but they always open with the "About Us" tab showing and then as soon as you click on a different tab you see it highlight for a second and then it just reverts back to the About Us tab even though the page has changed. As the site opens I obviously want the first tab to be highlighted as opposed to the 2nd one and the each page highlights and holds as you go through the menu.
A: See, you set
var bselectedItem=2;
That is why "About us" tab is selected.
You should change the selected tab depending on the page you are now.
This Tabs menu can save pressed item automatically within1 page only. If you open another page, the menu can't remember presseditem. You should do that manually using Javascript and menu parameters( var bselectedItem) or using any server-side script (php, asp, etc.)
Deluxe Tabs doesn't support API functions which can return theselected tab.
If your site is written on PHP you can set "bselectedItem" parameter based on your link beforeyou call tabs-kasper.js file.
For example, move "bselectedItem" parameter from tabs-kasper.js file to yourcode.
<TD vAlign=top align=left>
/* Select Tab */
<script type="text/javascript" language="JavaScript1.2">
var bselectedItem=<?php echo $seltabs; ?>;
</script>
<SCRIPT src="tabs-kasper.js" type=text/javascript></SCRIPT>
</TD>
You should define seltabs using server side script.
You can also set on every page before you call tabs-kasper.js file(for example, for solution tab).
<TD vAlign=top align=left>
/* Select Tab */
<script type="text/javascript" language="JavaScript1.2">
var bselectedItem=4;
</script>
<SCRIPT src="tabs-kasper.js" type=text/javascript></SCRIPT>
</TD>
Try that.
Q: Is there a way to hide a menu options in the navigation menu using either CSS or the java api based on the site user?
A: JavaScript Tree Menu supports Javascript API.
You can find more info here:
http://deluxe-menu.com/dynamic-functions-sample.html
You can try to use API functions in that case:
function dm_ext_changeItemVisibility (menuInd, submenuInd, itemInd, visibility)
To disable items you should set the target parameter to "_".
You can try to use the following function
function disable() {
dm_ext_changeItem(0, 1, 1, ["", "", "", "", "", "_"]);
}
to disable your items.
Q: I have been using the DHTML Menu program for years and they are working good.
But I found an office where the javascript tree menu example just simply does'nt appear.
I am curious about it, why just in that office the Menu is not working.
I can note than other javascript routines I put on my page are not working neither.
Can you give me some idea of what can I check on the computers?
Something on the explorer? (IE6) , or a kind of program?
A: Your browser has JavaScript option disabled.
It means that no one JavaScript element can be run.
You should to enable JavaScript in IE:
Tools -> Internet Options -> Security -> Custom level... -> Scripting -> Active Scripting = Enable
There is no way to enable these preferences automatically, in othercase there are no reasons to create security preferences.
You can use search engine friendly code, so you'll see all yourlinks (for the main items and submenus) when your security settings in IE doesn't allow Javascript.
You can generate search engine friendly code.
JavaScript Tree Menu is a search engine friendly menu since v1.12.
To create a search engine friendly menu you should add additional html code within your html page:
<div id="dmlinks">
<a href="http://deluxe-menu.com">menu_item_text1</a>
<a href="http://deluxe-tree.com">menu_item_text2</a>
...etc.
</div>
To generate such a code use Deluxe Tuner application.
You can find this GUI in the trial package.
Run Tuner, load your menu and click Tools/Generate SE-friendly Code (F3).