Board Logo

Can't add an image?
nathanc - 5/13/2005 at 07:03 AM

My menu works fine before I try to add an image using the
"wrap_child" function. Code shown below.
But when I add the wrapper code the menu does not show on the web page. I guess because of a script error. Any ideas why?
If I use this code without the wrapper stuff it works fine.

var states = ['mout', 'mover', 'mdown'];

var MENU_ITEMS0 = [
['Computers', null, null,[wrap_child('Software', 'images/smallbullet.gif'), null, null], ['Hardware', null, null,['Games', null, null]]]
function wrap_child (text, icon) {
var res = new Array;
for (var i=0; i<states.length; i++)
res = '<table cellpadding="0" cellspacing="0" border="0" bgcolor="#DBEAF5" width="100%">
<table cellpadding="3" cellspacing="1" border="0" width="100%" height="24">
<td style="padding: 3px valign="middle">
&nbsp;' + (icon != null ? '<img src="icon" height="16" align="absmiddle">&nbsp;' : '') + '<font face="tahoma, verdana, arial" color="black"><span style="font-size: 12px;">' + text + '</span></font>
return res;

Back to forum: