I came up with a different idea, as the href="#" is not good for some browsers. Add this to your stylesheet:
Code:
.nolink, .nolink:hover {
background-color: black!important;
color: #ccc!important;
cursor: text;
}
Adjust as desired. Replace this part of the anylinkmenu.js file:
Code:
getmenuHTML:function(menuobj){
var menucontent=[]
var frag=""
for (var i=0; i<menuobj.items.length; i++){
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
}
},
with:
Code:
getmenuHTML:function(menuobj){
var menucontent=[]
var frag=frag2=""
for (var i=0; i<menuobj.items.length; i++){
frag2 = menuobj.items[i][1] === ''? 'class="nolink"' + '>' : 'href="' + menuobj.items[i][1] + '" target="' + menuobj.linktarget + '">';
frag+='<li><a ' + frag2 + 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
}
},
Now any item in a drop down that you wish to become not a link, but a header of sorts, set its 2nd value in menucontents.js to "", ex:
Code:
var anylinkmenu2={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#FDD271', linktarget:'_new'} //Second menu variable. Same precaution.
anylinkmenu2.items=[
["CNN", "http://www.cnn.com/"],
["MSNBC", ""],
["Google", "http://www.google.com/"],
["BBC News", "http://news.bbc.co.uk"] //no comma following last entry!
]
It will be given the 'nolink' class and have no href.
Bookmarks