PDA

View Full Version : AnyLink Multiple Columns Not Showing



igendreau
03-24-2010, 02:59 AM
1) Script Title: :: AnyLink JS Drop Down Menu v2.2

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

3) Describe problem: I'm a newbie, so bear with me. I did a basic drop-down menu on an image so when I roll over it, the image appears, and it works fine. But I tried following the instructions to divide into multiple columns and it still shows up in a single column. Here is the code in my menucontents.js file:


var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''} //First menu variable. Make sure "anylinkmenu1" is a unique name!
anylinkmenu1.cols={divclass:'column', inlinestyle:''} //menu.cols if defined creates columns of menu links segmented by keyword "efc"
anylinkmenu1.items=[
["Dynamic Drive", "http://www.dynamicdrive.com/"],
["CSS Drive", "http://www.cssdrive.com/"],
["JavaScript Kit", "http://www.javascriptkit.com/", "efc"],
["Coding Forums", "http://www.codingforums.com/"],
["JavaScript Reference", "http://www.javascriptkit.com/jsref/"] //no comma following last entry!
]

Here is my page, it is the "Teams" button in the menu: http://www.buxmonttorch.com/newmenusample.html

ddadmin
03-25-2010, 08:25 AM
There are minor errors in your menucontents.js file that's the cause, specifically, the code in red:


var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''} //First menu variable. Make sure "anylinkmenu1" is a unique name!
anylinkmenu1.cols={divclass:'column', inlinestyle:''} //menu.cols if defined creates columns of menu links segmented by keyword "efc"
anylinkmenu1.items=[
["Dynamic Drive", "http://www.dynamicdrive.com/"],
["CSS Drive", "http://www.cssdrive.com/"],
["JavaScript Kit", "http://www.javascriptkit.com/", "efc"],
["Coding Forums", "http://www.codingforums.com/"],
["JavaScript Reference", "http://www.javascriptkit.com/jsref/"] //no comma following last entry!
]



var anylinkmenu2={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#FDD271', linktarget:'_new'} //Second menu variable. Same precaution.
anylinkmenu2.items=[
["CNN", "http://www.cnn.com/"],
["MSNBC", "http://www.msnbc.com/"],
["Google", "http://www.google.com/"],
["BBC News", "http://news.bbc.co.uk"] //no comma following last entry!
]



var anylinkmenu3={divclass:'anylinkmenucols', inlinestyle:'', linktarget:'secwin'} //Third menu variable. Same precaution.
anylinkmenu3.cols={divclass:'column', inlinestyle:''} //menu.cols if defined creates columns of menu links segmented by keyword "efc"
anylinkmenu3.items=[
["Dynamic Drive", "http://www.dynamicdrive.com/"],
["CSS Drive", "http://www.cssdrive.com/"],
["JavaScript Kit", "http://www.javascriptkit.com/"],
["Coding Forums", "http://www.codingforums.com/"],
["JavaScript Reference", "http://www.javascriptkit.com/jsref/", "efc"],
["CNN", "http://www.cnn.com/"],
["MSNBC", "http://www.msnbc.com/"],
["Google", "http://www.google.com/"],
["BBC News", "http://news.bbc.co.uk", "efc"],
["News.com", "http://www.news.com/"],
["SlashDot", "http://www.slashdot.com/"],
["Digg", "http://www.digg.com/"],
["Tech Crunch", "http://techcrunch.com"] //no comma following last entry!
]

var anylinkmenu4={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#DFFDF4', linktarget:'_new'} //Second menu variable. Same precaution.
anylinkmenu4.items=[
["CNN", "http://www.cnn.com/"],
["MSNBC", "http://www.msnbc.com/"],
["Google", "http://www.google.com/"],
["BBC News", "http://news.bbc.co.uk"] //no comma following last entry!
]

var anylinkmenu5={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#DFFDF4', linktarget:'_self'} //Second menu variable. Same precaution.
anylinkmenu5.cols={divclass:'column', inlinestyle:''} //menu.cols if defined creates columns of menu links segmented by keyword "efc"
anylinkmenu5.items=[
["Mens Home", "http://www.cnn.com/"],
["Mens Roster", "http://www.msnbc.com/"],
["Mens Schedule", "http://www.google.com/", "efc"],
["Mens Standings", "http://news.bbc.co.uk"],
["Womens Home", "http://www.cnn.com/"],
["Womens Roster", "http://www.msnbc.com/", "efc"],
["Womens Schedule", "http://www.google.com/"],
["Womens Standings", "http://news.bbc.co.uk"]
]

"anylinkmenu" should be "anylinkmenucols".