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: Adding pop-up help text to the tree menu
BartH
Junior Member

Posts: 2
Registered: 12/17/2002
Member Is Offline
posted on 12/17/2002 at 06:12 PM Reply With Quote
Adding pop-up help text to the tree menu


I've wanted to add pop-up help text to the menu items (using the title tag to be precise) and I've come this far:

I've changed in tree_items.js

Code:

******
var TREE_ITEMS = [
['Home', 'http://www.homepage.com',
['Nowhere', null],
],
];
******

to

Code:

******
var TREE_ITEMS = [
['Home', 'http://www.homepage.com', 'My pop-up help text',
['Nowhere', null, 'My pop-up help text'],
],
];
******


and added in tree.js:

Code:

******
title="' + this.a_config[2] + '"

******


before the > in (line 123):

Code:

******
id="i_txt' + this.o_root.n_id + '_' + this.n_id + '"><img src="'
******

Now the text pops up fine, but the script thinks there are extra items, so it gives the items with the added third variable a child...

Anybody any suggestion?
View User's Profile View All Posts By User U2U Member
Ulukai
Member

Posts: 40
Registered: 11/27/2002
Location: Frankfurt, Germany
Member Is Offline
posted on 12/18/2002 at 01:41 PM Reply With Quote

Have a look at the function / constructor
tree_item. Theres a loop which constructs the children of a node.
Youi??ll have to change the part:

i < this.a_config.length- n

n stands for a number (I doni??t know the number of the unmodified tree). I guess, youi??ll have to subtract 1 from this number.
Therei??s another part in this function at the beginning.. It says:

this.a_config = o_parent.a_config[n_order + (this.n_depth ? n : 0)];

where n should be changed like the in the loop.

I did not test this, as Ii??m out of time at the moment. But Ii??m sure you find a solution when playing around with these two numbers.
CU

Ulukai
View User's Profile View All Posts By User U2U Member
BartH
Junior Member

Posts: 2
Registered: 12/17/2002
Member Is Offline
posted on 12/18/2002 at 08:13 PM Reply With Quote
Re: Adding pop-up help text to the tree menu


I've fiddled around as you suggested and seen all kinds of variations (no children, nothing at all, double children and even a drunken Santa falling out of his sleigh, bur nithing solved the problem so far. I don't like the idea I'm guessing in stead of knowing what I'm doing, so I'll await some founded advise. In the meanwhile I solved an other problem, where I wanted the "selection marks" to disappear, so I added some blur()'s at mouseUp here:

Code:

******
? '<a onmouseUp="this.blur();return true;" href="javascript: trees[' + this.o_root.n_id + '].toggle(' + this.n_id + ')"onmouseover="trees[' + this.o_root.n_id + '].mover(' + this.n_id + ')" onmouseout="trees[' + this.o_root.n_id + '].mout(' + this.n_id + ')"><img src="' + this.get_icon(true) + '" border="0" align="absbottom" name="j_img' + this.o_root.n_id + '_' + this.n_id + '"></a>'
: '<img src="' + this.get_icon(true) + '" border="0" align="absbottom">') : '')
+ '<a onmouseUp="this.blur();return true;" href="' + this.a_config[1] + '" target="' + this.o_root.a_tpl['target'] + '"onclick="return trees[' + this.o_root.n_id + '].select(' + this.n_id + ')" ondblclick="trees[' + this.o_root.n_id + '].toggle(' + this.n_id + ')" onmouseover="trees[' + this.o_root.n_id + '].mover(' + this.n_id + ')" onmouseout="trees[' + this.o_root.n_id + '].mout(' +this.n_id + ')" class="t' + this.o_root.n_id + 'i" id="i_txt' + this.o_root.n_id + '_' + this.n_id + '" title="' + this.a_config[2] + '"><img src="' + this.get_icon() + '" border="0" align="absbottom" name="i_img' + this.o_root.n_id + '_' + this.n_id + '" class="t' + this.o_root.n_id + 'im">' + this.a_config[0] + '</a></td></tr></table>' + (this.a_children.length ? '<div id="i_div' + this.o_root.n_id + '_' + this.n_id + '" style="display:none"></div>' : '');
******


Looking forward for next suggestions.
View User's Profile View All Posts By User U2U Member
Ulukai
Member

Posts: 40
Registered: 11/27/2002
Location: Frankfurt, Germany
Member Is Offline
posted on 12/18/2002 at 09:55 PM Reply With Quote

Hi,

the problem is the structure of the tree_items array.
There are a few entries like title and link. Any further item (any following item) is expected to be a child.
I added extra entries in this array too and solved the problem but as I modified more than that and as I do not have the time to experiment a lot with your problem, I suggest, you have a look at the thread "Icon per Item". You will find my version of the tree there. That is: It is allowed to have extra icons after the title of a node and some other stuff.
I had to modify the parts I mentioned in this thread, so look what I?ve done there.

I think you have to change the code at the place, where the children are detected. That?s exactly the place, I mentioned.

Be sure to add your help-text in each entry in tree_items. In other words make sure to have exactly 3 entries which are no children.

Perhaps this could help you.
CU

Ulukai
View User's Profile View All Posts By User U2U Member
Evan
Junior Member

Posts: 3
Registered: 12/20/2002
Member Is Offline
posted on 12/20/2002 at 09:27 PM Reply With Quote

Guys,

If it's what I think it is, then you're burning hot.

The issue is that the tree_items array is now one larger with the addition of help text. In the tree_item( ) function there are two uses of the number 2, which is the number of elements in the original array. If you change them to 3 (or whatever the size of the new array), that will do the trick.

Good luck!
Evan
View User's Profile View All Posts By User U2U Member
sundisno
Junior Member

Posts: 4
Registered: 2/11/2003
Member Is Offline
posted on 2/11/2003 at 07:45 AM Reply With Quote

I successfully implemented the help text through an menu, but now I'm facing the problem that only the first time when the item is selected, the item turns bold. When I select another item it will not be bold but normal. I have no knowledge of JSP so can someone give me the clue for the error?

Thanks
View User's Profile View All Posts By User U2U Member
sundisno
Junior Member

Posts: 4
Registered: 2/11/2003
Member Is Offline
posted on 2/12/2003 at 12:44 PM Reply With Quote

I did find the error. I removed the boolean in the return statement in item_select so the statement is now
return this.a_config[1].

Now is the menu also working for me in Netscape as he did not before
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Tigra Tree Menu
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
   
Tigra Tree Menu PRO
Product Demonstrations Live Demos
Multiple Trees
Frames Targeting
Icons and Styles Overloading
Event Handling
Performance Test
Version 1.2 features
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


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