|
|
|
How I can style all css expanding menu items to have font bold when selected?
Return to Recent Questions
Q:
Can you please give me tips on how I can style all css expanding menu items to
have font bold when selected and normal font when not selected?
A:
Unfortunately, Deluxe Tree doesn't have such a feature. You can only
set it's color. You cannot set the font of menu item bold when selected.
You can set menu item's font bold onMouseover, see example here:
http://dhtml-menu.com/dhtml-tree/data-templates/vista-style-7-template-sample.html
You should add
the following code in your data file:
function changeFont(obj, over)
{
obj.style.fontWeight = over ? 'bold' : 'normal';
obj.style.fontSize = over ? '13px' : '12px'; // You can not use this line
}
var tmenuItems = [
["<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Security</div>","", "", "", "", "", "", "", "", ],
["<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Ease of Access</div>","", "", "", "", "", "", "", "", ],
["|<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Internet Options</div>","", "", "", "", "", "", "", "", ],
["|<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Windows Firewall</div>","", "", "", "", "", "", "", "", ],
["<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Network and Internet</div>","", "", "", "", "", "", "", "", ],
["<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Hardware</div>","", "", "", "", "", "", "", "", ],
["<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Programs</div>","", "", "", "", "", "", "", "", ],
["<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Appearance</div>","", "", "", "", "", "", "", "", ],
["|<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>User Accounts</div>","", "", "", "", "", "", "", "", ],
["|<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Personalization</div>","", "", "", "", "", "", "", "", ],
["<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Sound and Speech</div>","", "", "", "", "", "", "", "", ],
["<div onMouseOver='changeFont(this, 1)' onMouseOut='changeFont(this, 0)'>Additional Options</div>","", "", "", "", "", "", "", "", ],
];
Please, notice also that you should add this function every time when
you change your css expanding menu in DHTML Tuner application, as Tuner deletes
this function.
Return to Recent Questions
Related:
- March 12, 2007 - I have problems with image paths when I create css pop up menu in DHTML Tuner.
- May 22, 2007 - I would like to have links of menu html to our website when javascript turned off.
- Jun 17, 2007 - I want to have a different font and color for my net web menu submenu items...
- Jul 30, 2007 - I need the cursor not to change when hovering over items which don't have links in popup menu javascript
- Sep 14, 2007 - We have errors in the drop down menu bar when we use two drop down menu bar on the one page.
- Oct 12, 2007 - I would like to add bold as a menus for web pages font decoration. Is it possible?
- Nov 12, 2007 - How do I highlight main dhtml drop down menus items when I selected a main category?
- Dec 11, 2007 - I would like to add bold as a javascript popup menu font decoration. Is it possible?
- Jan 05, 2008 - I have the errors in the dhtml menu javascript when I use it in cross-frame mode
- Jan 23, 2008 - Is it possible set a pressed item when you have multiple mouse button menu on the page?
- Jan 25, 2008 - Can a dhtml menu code item that expands the submenu items when selected work as link?
|