Recent Questions Sitecore Treelist Field Validation Dynamic
Q: What do you recommend for "remembering" the tab in the js tab menu,
so that when the page reloads the correct tab is highlighted.
A: Deluxe Tabs doesn't support API functions which can return theselected tab aslo.
You can set "bselectedItem" and " var bselectedSmItem" parametersbased on your link before you call your data file.
For example, move " var bselectedItem" and " var bselectedSmItem" parametersfrom your data file to your code.
<TD vAlign=top align=left>
/* Select Tab */
<script type="text/javascript" language="JavaScript1.2">
var bselectedItem=<?php echo $seltabs; ?>;
var bselectedSmItem=^lt;?php echo $selsmtabs; ?>;
</script>
<SCRIPT src="data.js" type=text/javascript></SCRIPT>
</TD>
You should define seltabs and selsmtabs using server side script.
You can also set it on every page before you call data.js file, forexample:
<TD vAlign=top align=left>
/* Select Tab */
<script type="text/javascript" language="JavaScript1.2">
var bselectedItem=4;
var bselectedSmItem=3;
</script>
<SCRIPT src="data.js" type=text/javascript></SCRIPT>
</TD>
Q: I was wondering how do i add more then five items on the top of the select menu javascript rathere then using a sub menu?
A: Actually you can add as many top items as you want.
Use Deluxe Tuner to add more items or add them in your data filemanually, for example:
var menuItems = [
["Item 1","whatsnew.htm", "Buttons/whatsnewup.jpg", "Buttons/whatsnewover.jpg", "", "", "", "", "", "", "", ],
["Item 2","test.htm", "", "", "", "", "", "", "", "", "", ],
["Item 3","index.htm", "Buttons/homeup.jpg", "Buttons/homeover.jpg", "", "_parent", "", "", "", "", "", ],
["Item 4","about.htm", "Buttons/aboutup.jpg", "Buttons/aboutover.jpg", "", "_parent", "", "", "", "", "", ],
["Item 5","commserv.htm", "buttons/commservup.jpg", "buttons/commservover.jpg", "", "_parent", "", "", "", "", "", ],
["Item 6","conference.htm", "buttons/conferenceup.jpg", "buttons/conferenceover.jpg", "", "_parent", "", "", "", "", "", ],
["Item 7","lodges.htm", "buttons/districtsup.jpg", "", "", "_parent", "", "", "", "", "", ],
Q: Very interested by your product, I want to know, before buy, if I can call javascript function when the user click on a menu Items;
you have this example, but I want the possibility to call a javascript function in the client side :
var menuItems = [
[text, "javascript:alert('Hello, world!')", icon1, icon2],
];
Is it possible, if yes could you give the sample, because Milovic menu have a javascript:function call, what about your product ?
Thank you for the answer.
A: You're able to use Javascript for each item, for example:
var menuitems = [
["item text", "javascript:your_code_here"]
];
Unfortunately, you can't assign onmouseover/onClick event to each item.
However, you can achieve this by using standard html objects within items, for example:
var menuitems = [
["<div onClick='your_code_here'>item text</div>", "index.html"]
];
Unfortunately we don't have such example.
Q: If i use windows tree menu and published on my web site it is default all menu and submenu are opened .
I want that all html tree menu is default closed if user click on main menu it will be opened submenu.
Please wich parameters i have to change.
A: You should set the following parameter:
var texpanded=0;
Check also that you don't have '+' sign before item's text in the top items, for example:
["+Home","", "", "", "", "", "", "0", "", ],
...
["+Item1","", "", "", "", "", "", "0", "", ],