corduroy
Junior Member
Posts: 3
Registered: 9/16/2004
Member Is Offline
|
| posted on 9/16/2004 at 08:07 PM |
|
|
Text Styles
Does anyone know how I can get the styles in the tree_tpl.js file to overwrite the default text colors set in the main html page.
I would like the text color to change when a node or leaf is selected, but it will not overwrite the alink and vlink color set in the main html
page.
thanks.
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 9/17/2004 at 08:14 AM |
|
|
You could use style classifiers like:
.t0i {...}
.t0i a:link {...}
.t0i a:visited {...}
.t0i a:hover {...}
.t0i a:active {...}
|
|
|
corduroy
Junior Member
Posts: 3
Registered: 9/16/2004
Member Is Offline
|
| posted on 9/17/2004 at 07:49 PM |
|
|
This works, but the problem is it permanently changes the colors of the links. The colors do not change back after another menu item is selected.
I'm trying to make it so that the text changes color when a menu item is selected to let the user know what they currently have selected, do you
know what the best way is to go about this?
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 9/18/2004 at 10:59 AM |
|
|
Style of the selected item is changed in the item_select function, where you could find instuction:
function item_select (b_deselect) {
//...
get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' :
'bold';
//...
}
You could use it as a pattern to apply your own style changes.
Note: PRO version has powerful facilities
to change item's text style in any acceptable states via CSS classes.
|
|
|
corduroy
Junior Member
Posts: 3
Registered: 9/16/2004
Member Is Offline
|
| posted on 9/21/2004 at 09:42 PM |
|
|
Actually, all I did was define only the vlink color and that seemed to work. Thanks for all your help.
|
|
|
Rambabu Kodali
Member
Posts: 11
Registered: 11/18/2004
Member Is Offline
|
| posted on 12/2/2004 at 05:25 AM |
|
|
item_select ?
can u please tell me where exactly i have to use this function and how to use.
Style of the selected item is changed in the item_select function, where you could find instuction:
function item_select (b_deselect) {
//...
get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' : 'bold';
//...
}
You could use it as a pattern to apply your own style changes.
Thanks
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 12/2/2004 at 09:35 AM |
|
|
This function is already defined in tree.js file. In the previous post I've commented all functionality except the style changing. You can see
how bold style is applied and use the pattern to apply your own style changes.
|
|
|
Rambabu Kodali
Member
Posts: 11
Registered: 11/18/2004
Member Is Offline
|
| posted on 12/2/2004 at 10:09 AM |
|
|
item_select is not in tree.js
We don't have item_select in tree.js files. Can you please tell me how to make selected text bold with out calling this event.
Thanks.
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 12/2/2004 at 01:55 PM |
|
|
Are you using PRO version or free one?
For PRO version you should setup corresponding styles (use font-weight: bold; to bold text) and assign them via template (tree_tpl.js) to appropriate
items categories.
|
|
|
Rambabu Kodali
Member
Posts: 11
Registered: 11/18/2004
Member Is Offline
|
| posted on 12/3/2004 at 08:39 AM |
|
|
How to make selected node text bold?
Hi, Can you more specific.
I am using Pro version
I am explaining how i was doing
I defined style in CSS like
.tb {
font-family: Tahoma, Verdana .....
font-size : 12px
font-weight : bold
color : #000000;
.......
}
and i am assigning this style to following style elements:
style_52 = "tb" for selected root caption style
style_20 = "tb" for selected node caption style
style_4 = "tb" for selected leaf caption style
I am applying css to tree.
Is this correct way ?
Can you give me more specific details
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 12/3/2004 at 10:59 AM |
|
|
Please find the sample in the attachment
Attachment: bold_style.zip (1.07kb)
This file has been downloaded 588 times
|
|
|
Rambabu Kodali
Member
Posts: 11
Registered: 11/18/2004
Member Is Offline
|
| posted on 12/8/2004 at 04:22 AM |
|
|
Hi,
I downloaded the above zip file and applied the same css and the styles. Still i am unable to make selected node text bold.
Thanks
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 12/8/2004 at 09:20 AM |
|
|
Make sure you have no global style settings for anchors
|
|
|
Rambabu Kodali
Member
Posts: 11
Registered: 11/18/2004
Member Is Offline
|
| posted on 12/10/2004 at 10:01 AM |
|
|
Hi,
I have not used the following styles, still selected node text is not getting bold.
<style>
a, A:link, a:visited, a:active
{color: #0000aa; text-decoration: none; font-family: Tahoma, Verdana; font-size: 11px}
A:hover
{color: #ff0000; text-decoration: none; font-family: Tahoma, Verdana; font-size: 11px}
p, tr, td, ul, li
{color: #000000; font-family: Tahoma, Verdana; font-size: 11px}
.header1, h1
{color: #ffffff; background: #4682B4; font-weight: bold; font-family: Tahoma, Verdana; font-size: 13px; margin: 0px; padding: 2px;}
.header2, h2
{color: #000000; background: #DBEAF5; font-weight: bold; font-family: Tahoma, Verdana; font-size: 12px;}
.intd
{color: #000000; font-family: Tahoma, Verdana; font-size: 11px; padding-left: 15px; padding-right: 15px;}
</style>
Thanks
|
|
|
tigra
Administrator
Posts: 1990
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 3/8/2005 at 12:02 AM |
|
|
Solution to the font settings issue is provided in the product documentation at:
http://www.softcomplex.com/products/tigra_tree_menu_pro/docs/#styles
|
|
|