Hi again. I got it working with pictures on my own. Here's the hack for anylinkmenu.js:
Code:
getmenuHTML:function(menuobj){
var menucontent=[]
var frag=""
for (var i=0; i<menuobj.items.length; i++){
if (menuobj.items[i][3]=="img"){
frag+='<li><a href="' + menuobj.items[i][1] + '" target="' + menuobj.linktarget + '"><img src="' + menuobj.items[i][0] + '"></a></li>\n'
}
else{
frag+='<li><a href="' + menuobj.items[i][1] + '" target="' + menuobj.linktarget + '">' + menuobj.items[i][0] + '</a></li>\n'
}
if (menuobj.items[i][2]=="efc" || i==menuobj.items.length-1){
menucontent.push(frag)
frag=""
}
}
if (typeof menuobj.cols=="undefined")
return '<ul>\n' + menucontent.join('') + '\n</ul>'
else{
frag=""
for (var i=0; i<menucontent.length; i++){
frag+='<div class="' + menuobj.cols.divclass + '" style="' + menuobj.cols.inlinestyle + '">\n<ul>\n' + menucontent[i] + '</ul>\n</div>\n'
}
return frag
}
},
What i did here was add an if statement to check for the presence of the phrase "img" on a 4th colum (represented by menuobj.items[i][3] in above the code). If [i][3]==img, then the program prints the image url located in [i][0] into a linked image template. Otherwise, it generates the normal text link.
Here's a sample of what a normal link looks like in menucontents.js:
Code:
["Dynamic Drive", "http://www.dynamicdrive.com/"],
Here's a sample of what a link that starts a new row looks like in menucontents.js:
Code:
["Dynamic Drive", "http://www.dynamicdrive.com/", "efc"],
Notice the third column menuobj.items[i][2]==efc to signal new row
Now here's a sample of what a linked image looks like in menucontents.js:
Code:
["http://www.dynamicdrive.com/favicon.ico", "http://www.dynamicdrive.com/","","img"],
Notice menuobj.items[i][2] is needed to create menuobj.items[i][3]==img
Thanks for looking. I will post a link to my site once i've got my menu finished, so you can all see what it looks like.
Bookmarks