maxsbonsai
02-07-2009, 11:57 PM
Hi there. I just got anylink drop down menu up and running for my site, and it works great!
Here's where to find it:
http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm
I want to create one more dropdown, however, with a bunch of buttons so visitors can bookmark my page on delicious, or open a popup, among other things.
My button for delicious, for example, would have a link location like:
javascript:(function(){f='http://delicious.com/save?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&v=5&';a=function(){if(!window.open(f+'noui=1&jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()
The button would also use an image instead of text. In this example, we have:
http://delicious.com/favicon.ico
Pasting these values into menucontents.js doesn't work. I have a feeling this is because (1)the values in menucontents.js are not full links, and (2) these values are defined within qoutation marks (the program looks for values between the " " ).
I took a peek at anylinkmenu.js, and here is the section that generates the html links for the menu. The program creates links by pasting the link url and corresponding link text into a sort of link template.
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
}
},
What I'm considering is to have my links saved in menucontents.js as entire links, just one list- not two columns. Next, I would change the above code to just paste the entire link from menucontents.js.
What do you think? Suggestions? Is there anything I missed? Will you please help me implement these changes? I'm decent with computers, but not much of a javascript guy. Thanks in advance. Your help and comments are much appreciated.
-Max
Here's where to find it:
http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm
I want to create one more dropdown, however, with a bunch of buttons so visitors can bookmark my page on delicious, or open a popup, among other things.
My button for delicious, for example, would have a link location like:
javascript:(function(){f='http://delicious.com/save?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&v=5&';a=function(){if(!window.open(f+'noui=1&jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()
The button would also use an image instead of text. In this example, we have:
http://delicious.com/favicon.ico
Pasting these values into menucontents.js doesn't work. I have a feeling this is because (1)the values in menucontents.js are not full links, and (2) these values are defined within qoutation marks (the program looks for values between the " " ).
I took a peek at anylinkmenu.js, and here is the section that generates the html links for the menu. The program creates links by pasting the link url and corresponding link text into a sort of link template.
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
}
},
What I'm considering is to have my links saved in menucontents.js as entire links, just one list- not two columns. Next, I would change the above code to just paste the entire link from menucontents.js.
What do you think? Suggestions? Is there anything I missed? Will you please help me implement these changes? I'm decent with computers, but not much of a javascript guy. Thanks in advance. Your help and comments are much appreciated.
-Max