JavaScript.CoolDev.Com Support Forums

Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Background colors for nodes

 
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsTree
Author Message
JasonVU
Guest





PostPosted: Mon Jun 23, 2003 8:49 pm    Post subject: Background colors for nodes Reply with quote

Is there a way to make the background color for nodes span the entire width of the menu instead of just over the text part of the node? Thanks for any help!

Jason
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Tue Jun 24, 2003 3:53 pm    Post subject: Reply with quote

Yes, there is some way.
Let's assume that your tree has "Tree1" name (i.e. it was created with the followin initialization string: "new COOLjsTree('Tree1', ...)"). If it is so, then you can define CSS classes in the form "cls<Tree Name>_back<Level Number>". These classes will be applied to individual items (one item is one separate table) of the specified level. E.g.:
Code:
.clsTree1_back1 {
   width: 120px;
   background-color: red;
}

.clsTree1_back0 {
   width: 120px;
   background-color: blue;
}

.clsTree1_back2 {
   width: 120px;
   background-color: green;
}

These lines of CSS code will make your tree look like block of 120 px, level 0 will have blue items, level 1 - red items, and level 2 - green items.
Back to top
guldam
Guest





PostPosted: Tue Aug 26, 2003 10:31 pm    Post subject: Background colors for nodes Reply with quote

I've been trying to apply the background colors for nodes as you've shown us here, but I'm having zero luck.

1. I'm not using the proversion of cooltrees
2. I put this in my stylesheet:
.clsTree1_back1 {
   width: 120px;
   background-color: red;
}

.clsTree1_back0 {
   width: 120px;
   background-color: blue;
}

.clsTree1_back2 {
   width: 120px;
   background-color: green;
}
3.My tree is called: Tree1
4. the Tree works fine and dandy but I can't change bgcolors.
5.tree1_format.js has this for item #11 but I also got rid of this and it didn't work:
//11. styles for each level of menu (default style will be used for undefined levels)
[clsTree1_back1,clsTree1_back0,clsTree1_back2],

Any ideas?

Guldam
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Tue Aug 26, 2003 11:24 pm    Post subject: Reply with quote

I've tested that sample before posting - things were fine...
What is the version of your cooltree.js? Can you quote your initialization sequence (new COOLjsTree...)?
Back to top
Guest






PostPosted: Wed Aug 27, 2003 12:45 am    Post subject: Reply with quote

// Title: COOLjsTree
// Version: 1.4.0.


<script language="JavaScript">
var treeName = "Tree1";
new COOLjsTree (treeName, TREE1_NODES, TREE1_FORMAT);
</script>

I'm still scratching my head. oh, I'm using this in a frameset.

Thanks,

Guldam
Back to top
guldam
Guest





PostPosted: Wed Aug 27, 2003 12:59 am    Post subject: Background colors for nodes Reply with quote

http://www.fishyfish.com/img/leftnav.gif

Also, will the pro version of cooltree allow me to make it cosmetically look like the image I've linked to? My client will accept nothing less. errrg.

Thanks,
Guldam
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Wed Aug 27, 2003 2:28 am    Post subject: Reply with quote

Regarding background colors. Sorry, but it just works. Can you send your files zipped to jssupport@cooldev.com?

Regarding your tree sample. In this particular case Pro will not work better than non-Pro (tech.support team can help you setting this sample up: contact alx@cooldev.com - me - or galchenok@cooldev.com). But make sure that you really don't need other features of Pro.
Back to top
Guest






PostPosted: Wed Aug 27, 2003 9:54 pm    Post subject: Post subject: Background colors for nodes Reply with quote

I guess I'm missing something. I just downloaded a fresh copy of all the files from:
http://javascript.cooldev.com/testdoc/tree/samples/cooljstree.zip

I added a fresh copy of the cooltree.js file to this folder. The Tree works perfectly. If I add the following classes to the stylesheet, I get no change in background color and nothing else appears to be affected in the tree.

.clsTree1_back1 {
   width: 120px;
   background-color: #FFFF00;
}

.clsTree1_back0 {
   width: 120px;
   background-color: blue;
}

.clsTree1_back2 {
   width: 120px;
   background-color: green;
}

I've put this up on my personal website for testing purposes.

http://www.fishyfish.com/cooljstree

Sorry to be a pain.

Guldam
Back to top
Guest






PostPosted: Thu Aug 28, 2003 5:58 pm    Post subject: Reply with quote

For whatever strange and bizarre reason, I've gotten the background colors to work on the cooltree. I started from scratch yet again, and don't think I did anything differently, but I must have had a bug somewhere.

Now that I have things working, is there a way I can alternate row colors on clsTree_back2 (level three)?

thanks,

Guldam
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Mon Sep 01, 2003 12:50 am    Post subject: Reply with quote

Regarding misterious things that happen. Probably, some cache - browser's or some intermediate proxy...

Reagarding color alteration. Sorry, can't understand: all previous posts in this topic were about this. Probably I don't get something... Please explain me.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsTree All times are GMT
Page 1 of 1