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: Weird tree icon behavior
Doug
Junior Member

Posts: 2
Registered: 12/8/2002
Member Is Offline
posted on 12/8/2002 at 06:15 PM Reply With Quote
Weird tree icon behavior


I have an oddity here:

I have a simple tree with the basic set of icons unmodified from the original distribution.

When I open and close folders, sometimes IE just hangs there trying to reload the icons and times out, leaving empty "blanks" instead of lines/folders/etc.

The more I start to open and close folders, the more these blanks start showing up.

1) Could this be a server problem? Im using the goahead server embedded in vxWorks.

2) Could this be a caching issue? Im wondering why it is having to reload anything.

Any help is appreciated.
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/9/2002 at 08:38 PM Reply With Quote

Not sure if I can help you.
I had this problem when modifying the tree for showing special icons.
The problem was that I didn?t preload the images. After I implemented preloading, the problem was gone.
So your problem looks like a caching problem for me...
CU

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

Posts: 2
Registered: 12/8/2002
Member Is Offline
posted on 12/12/2002 at 05:22 PM Reply With Quote

How do I preload the images?

That sounds like a good idea.
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/17/2002 at 11:01 AM Reply With Quote

If you?re using an unmodified version of the tree, you don?t need to preload anything, the tree does that for you.
Normally it is done by creating an Image Object, setting its source to the image you want to preload and _reference_ the Image Object (perhaps in a global array).

var img = new Image();
img.src = "myImages/myImage.gif";
myLastingReference = img;

Now I think, that its a server problem for you. It seems that we have similar problems here after moving the site to another server. I think the servercaching has to be modified.. But as I don?t know much about servers, I?m not sure. I?ll tell you when we worked that problem out.
CU

Ulukai
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/17/2002 at 03:30 PM Reply With Quote

This turns out to be a heavy problem for us too.. we didn?t find a solution yet. If anyone knows something about this behaviour and how to stop it, please post it here.
I saw the post about the apache 'icon'-directory and I guess that?s not our problem. Here we use the IIS.

CU

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

Posts: 5
Registered: 12/18/2002
Member Is Offline
posted on 12/18/2002 at 08:43 PM Reply With Quote
icons


I am having a small problem with this tree menu thing.

I have got it working as such. When i make the actual page in front page and preview in my browser it works fine.

When I publish the web page the menu itself works however there are no icons at all.

I dont really know anything about html so I'm not usre how to get the icons to work.

i even tried extracting the original tigra_tree_menu.zip and just uploaded it as is, i still get no icons.

Please Help.
View User's Profile View All Posts By User U2U Member
evil_dude_01
Junior Member

Posts: 5
Registered: 12/18/2002
Member Is Offline
posted on 12/18/2002 at 09:27 PM Reply With Quote
Solved.


Right i was speaking to a guy i know and he has helped me to solve this problem.

[ ]+Home
[ ]+Blah Blah

See when i published the page i was not seeing the icons at all. i.e [ ]+

My web browser was saying the icons were not there.

All I did was rename the icons folder to tree_icons.

i changed all the java links in tree_tpl.js to

tree_icons/empty.gif',

and it works now.
View User's Profile View All Posts By User U2U Member
Pecker
Newbie

Posts: 1
Registered: 3/12/2003
Member Is Offline
posted on 3/12/2003 at 01:45 PM Reply With Quote
Cause of missing icons and slow refresh times under IE


I think I have discovered the cause of this mysterious problem.

Please refer to Microsoft Knowledge Base article 269802

This article describes how creating an img tag by setting the innerHTML property can cause IE to timeout and never load the image.

Further article Q319546 details how img tags created dynamically with innerHTML do not use the cached image and rather pulls it from the server again. This would explain posts in this forum regarding slow opening of tree folders.
View User's Profile View All Posts By User U2U Member
Peter Phang
Junior Member

Posts: 2
Registered: 4/3/2003
Member Is Offline
posted on 4/3/2003 at 08:17 AM Reply With Quote

Try changing these few lines...

var o_icone = new Image(),
o_iconl = new Image();
o_icone.src = a_template['icon_e'];
o_iconl.src = a_template['icon_l'];
a_template['im_e'] = o_icone;
a_template['im_l'] = o_iconl;
for (var i = 0; i < 64; i++)
if (a_template['icon_' + i]) {
var o_icon = new Image();
a_template['im_' + i] = o_icon;
o_icon.src = a_template['icon_' + i];
}



To these few lines...


a_template['im_e'] = new Image();
a_template['im_l'] = new Image();
a_template['im_e'].src = a_template['icon_e'];
a_template['im_l'].src = a_template['icon_l'];
for (var i = 0; i < 64; i++)
if (a_template['icon_' + i]) {
a_template['im_' + i] = new Image();
a_template['im_' + i].src = a_template['icon_' + i];
}

in the function tree() in tree.js file.
View User's Profile View All Posts By User U2U Member
Peter Phang
Junior Member

Posts: 2
Registered: 4/3/2003
Member Is Offline
posted on 4/10/2003 at 03:23 AM Reply With Quote

In addition these should be added:

Change these lines in function tree():

this.mout = function ...
this.mover = function ...

to:

this.mout = function (n_id) { var o_item = this.a_index[n_id]; o_item.upicon(); o_item.upstatus(true) };
this.mover = function (n_id) { var o_item = this.a_index[n_id]; o_item.upicon(); o_item.upstatus() };


Add this line to function tree_item():

this.upicon = item_upicon;


Add this function:

function item_upicon () {
var o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id];
if (o_iicon) o_iicon.src = this.get_icon();
}
View User's Profile View All Posts By User U2U Member
sxz7728
Newbie

Posts: 1
Registered: 11/16/2005
Member Is Offline
posted on 11/16/2005 at 08:12 AM Reply With Quote
try it


// Title: Tigra Tree
// Description: See the demo at url
// URL: http://www.softcomplex.com/products/tigra_menu_tree/
// Version: 1.1
// Date: 11-12-2002 (mm-dd-yyyy)
// Notes: This script is free. Visit official site for further details.

function tree (a_items, a_template) {
this.a_tpl = a_template;
this.a_config = a_items;
this.o_root = this;
this.a_index = [];
this.o_selected = null;
this.n_depth = -1;

var o_icone = new Image(),
o_iconl = new Image();

//Shen
var imgs = [];
this.a_imgs = imgs;
this.images = [];

imgs.clone = function(i)
{
var img = new Image();
img.src = this.src;
img.width = this.width;
img.height = this.height;
return img;
}

imgs['im_e'] = o_icone;
imgs['im_l'] = o_iconl;
//Shen

o_icone.src = a_template['icon_e'];
o_iconl.src = a_template['icon_l'];
a_template['im_e'] = o_icone;
a_template['im_l'] = o_iconl;

for (var i = 0; i < 64; i++)
if (a_template['icon_' + i]) {
var o_icon = new Image();

a_template['im_' + i] = o_icon;
o_icon.src = a_template['icon_' + i];

//Shen
imgs['im_' + i] = o_icon;
//Shen
}

this.toggle = function (n_id) { var o_item = this.a_index[n_id]; o_item.open(o_item.b_opened) };
this.select = function (n_id) { return this.a_index[n_id].select(); };
this.mout = function (n_id) { this.a_index[n_id].upstatus(true) };
this.mover = function (n_id) { this.a_index[n_id].upstatus() };

this.a_children = [];

for (var i = 0; i < a_items.length; i++)
new tree_item(this, i);

this.n_id = trees.length;
trees[this.n_id] = this;

for (var i = 0; i < this.a_children.length; i++) {
document.write(this.a_children.init());
this.a_children.open();
}

//Shen
this.expand_all = function () {
for (var i = 0; i < this.a_index.length; i++) {
this.a_index.open(false);
}
};

this.collapse_all = function () {
for (var i = 0; i < this.a_index.length; i++) {
if(this.a_index.n_depth >= 1)
this.a_index.open(true);
}
};
//Shen
}

function tree_item (o_parent, n_order) {
this.n_depth = o_parent.n_depth + 1;
this.a_config = o_parent.a_config[n_order + (this.n_depth ? 2 : 0)];
if (!this.a_config) return;

this.o_root = o_parent.o_root;
this.o_parent = o_parent;
this.n_order = n_order;
this.b_opened = !this.n_depth;

this.n_id = this.o_root.a_index.length;
this.o_root.a_index[this.n_id] = this;
o_parent.a_children[n_order] = this;

this.a_children = [];
for (var i = 0; i < this.a_config.length - 2; i++)
new tree_item(this, i);

this.get_icon = item_get_icon;
this.open = item_open;
this.select = item_select;
this.init = item_init;
this.upstatus = item_upstatus;
this.is_last = function () { return this.n_order == this.o_parent.a_children.length - 1 };

//Shen
this.get_icon_num = item_get_icon_num;
//Shen
}

function item_open (b_close) {
var o_idiv = get_element('i_div' + this.o_root.n_id + '_' + this.n_id);
if (!o_idiv) return;

if (!o_idiv.innerHTML) {
var a_children = [];
for (var i = 0; i < this.a_children.length; i++)
a_children= this.a_children.init();
o_idiv.innerHTML = a_children.join('');

//Shen
insert_img(o_idiv, this);
//Shen
}
o_idiv.style.display = (b_close ? 'none' : 'block');

this.b_opened = !b_close;

//Shen
// var o_jicon = document.images['j_img' + this.o_root.n_id + '_' + this.n_id],
// o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id];
var o_jicon = this.o_root.images['j_img' + this.o_root.n_id + '_' + this.n_id],
o_iicon = this.o_root.images['i_img' + this.o_root.n_id + '_' + this.n_id];
//Shen

if (o_jicon) o_jicon.src = this.get_icon(true);
if (o_iicon) o_iicon.src = this.get_icon();
this.upstatus();
}

function item_select (b_deselect) {
if (!b_deselect) {
var o_olditem = this.o_root.o_selected;
this.o_root.o_selected = this;
if (o_olditem) o_olditem.select(true);
}

//Shen
// var o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id];
var o_iicon = this.o_root.images['i_img' + this.o_root.n_id + '_' + this.n_id];
//Shen

if (o_iicon) o_iicon.src = this.get_icon();
get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' : 'bold';

this.upstatus();
return Boolean(this.a_config[1]);
}

function item_upstatus (b_clear) {
window.setTimeout('window.status="' + (b_clear ? '' : this.a_config[0] + (this.a_config[1] ? ' ('+ this.a_config[1] + ')' : '')) + '"', 10);
}

function item_init () {
var a_offset = [],
o_current_item = this.o_parent;
//Shen
/*
for (var i = this.n_depth; i > 1; i--) {
a_offset = '<img src="' + this.o_root.a_tpl[o_current_item.is_last() ? 'icon_e' : 'icon_l'] + '" border="0" align="absbottom">';
o_current_item = o_current_item.o_parent;
}
return '<table cellpadding="0" cellspacing="0" border="0"><tr><td nowrap>' + (this.n_depth ? a_offset.join('') + (this.a_children.length
? '<a 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 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 + '"><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>' : '');

*/
for (var i = this.n_depth; i > 1; i--) {
a_offset = '<span id="' + (o_current_item.is_last() ? ('span1_e_') : ('span1_l_')) + this.o_root.n_id + '_' + this.n_id + '_' + i + '" name=""></span>';
o_current_item = o_current_item.o_parent;
}

return '<table cellpadding="0" cellspacing="0" border="0"><tr><td nowrap>' + (this.n_depth ? a_offset.join('') + (this.a_children.length
? '<a 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 + ')">'
+ '<span id="span1_' + this.get_icon_num(true) + '_' + this.o_root.n_id + '_' + this.n_id + '_a" name="j_img' + this.o_root.n_id + '_' + this.n_id + '"></span>'
+ '</a>'
: '<span id="span1_' + this.get_icon_num(true) + '_' + this.o_root.n_id + '_' + this.n_id + '_b" name=""></span>') : '')
+ '<a 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 + '">'
+ '<span id="span1_' + this.get_icon_num() + '_' + this.o_root.n_id + '_' + this.n_id + '_c" name="i_img' + this.o_root.n_id + '_' + this.n_id + '" class="t' + this.o_root.n_id + 'im"></span>'
+ 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>' : '');
//Shen
}

function item_get_icon (b_junction) {
return this.o_root.a_tpl['icon_' + ((this.n_depth ? 0 : 32) + (this.a_children.length ? 16 : 0) + (this.a_children.length && this.b_opened ? 8 : 0) + (!b_junction && this.o_root.o_selected == this ? 4 : 0) + (b_junction ? 2 : 0) + (b_junction && this.is_last() ? 1 : 0))];
}

//Shen
function item_get_icon_num(b_junction) {
return ((this.n_depth ? 0 : 32) + (this.a_children.length ? 16 : 0) + (this.a_children.length && this.b_opened ? 8 : 0) + (!b_junction && this.o_root.o_selected == this ? 4 : 0) + (b_junction ? 2 : 0) + (b_junction && this.is_last() ? 1 : 0));
}

function insert_img(obj, item)
{
var objs = obj.getElementsByTagName("span");

for(i = 0; i < objs.length; i++)
{
var span = objs;
var sArray = span.id.split("_");

if(sArray[0] == "span1")
{
if(!span.innerHTML)
{
var img = item.o_root.a_imgs.clone("im_" + sArray[1]);
img.border = "0";
img.align = "absbottom";
img.name = span.name;
span.appendChild(img);

if(span.name != "")
{
item.o_root.images[span.name] = img;
}
}
}
}
}
//Shen

var trees = [];
get_element = document.all ?
function (s_id) { return document.all[s_id] } :
function (s_id) { return document.getElementById(s_id) };
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