Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: selected menu entry is not displayed bold
hpbauer
Member

Posts: 12
Registered: 7/2/2004
Member Is Offline
posted on 7/12/2004 at 08:40 AM Reply With Quote
selected menu entry is not displayed bold


Hi,
I customized the tree menu for my own needs. But now I noticed that the selected menu-entry is not displayed 'bold' anymore.

The according code can be found in the function item_select (b_deselect) at the line get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' : 'bold';

I get a JavaScript Error, because the style-Attribut seems to be "null or undefined".
If I don't use the function get_element but use document.getElementById() instead, this JavaScript Error will be solved:
document.getElementById('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' : 'bold';

But the Element looks all the same. No bold text.

If i read out the fontWeight Attribute again it will be set correctly to 'bold':
alert(document.getElementById(...).style.fontWeight);

If I set another style Attribute (e.g. display="none") this will have no consequences, too (but I can read it out again and it is set correctly).

The object I want to modifiy the css-Attribute for seems to exist, because
(document.getElementById(...)) ? alert("yes") : alert("no");
returns yes.

I made some modifcations on the code at other locations. So I cannot say since which modification this error appears. Can someone help me? Who has an idea what I could have made wrong?
Thanks a lot,
PETRE
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 7/12/2004 at 09:36 AM Reply With Quote

Test following:
alert(document.getElementById(...).innerHTML);
should return corect item's content(image and caption);
View User's Profile View All Posts By User U2U Member
hpbauer
Member

Posts: 12
Registered: 7/2/2004
Member Is Offline
posted on 7/12/2004 at 09:45 AM Reply With Quote

Good hint. There is the problem:
Here only comes the image (see attached file). But the label is missing. I have no idea...

hpbauer has attached this image:
alert.gif - 6.52kb
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 7/12/2004 at 09:49 AM Reply With Quote

So probably you working with item (item id - this.n_id) not one you expected to.
View User's Profile View All Posts By User U2U Member
hpbauer
Member

Posts: 12
Registered: 7/2/2004
Member Is Offline
posted on 7/12/2004 at 10:18 AM Reply With Quote

sorry, but I do not understand your last answer. What do you mean wA?th "item(item id - this.n_id)"?
How could it happen that I got the wrong elementID?

Great service - your fast replies :)
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 7/12/2004 at 10:37 AM Reply With Quote

Try to call:
alert(this.a_config[0]);
alert(this.o_root.a_index[this.n_id].a_config[0]);
all should return correct caption of the item.
If caption is correct then the reason probably in changes I can not assume.
View User's Profile View All Posts By User U2U Member
hpbauer
Member

Posts: 12
Registered: 7/2/2004
Member Is Offline
posted on 7/12/2004 at 10:42 AM Reply With Quote

Thank you.
The object is the right one (alerts give the right message). So I have to search more.
View User's Profile View All Posts By User U2U Member
hpbauer
Member

Posts: 12
Registered: 7/2/2004
Member Is Offline
posted on 7/12/2004 at 12:51 PM Reply With Quote
Problem solved !!!


SOOOORRRY, I made a silly mistake.
I customized the output (=return of the item_init function). And the id we were talking about did exist two times. So it was no wonder,...
Greetings,
Peter
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos:
Frames targeting
Win help style
Free Download Free Download
Free Download Menu Builders
Online Builder
Product Documentation Documentation:
Documenation Page
Support Forum Technical Support
Support Forum
   

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004