PDA

View Full Version : Can I use Images within the drop down - AnyLink JS drop down menu?



adam_design
01-21-2011, 08:33 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 am using anylinkmenu3 with the multiple columns which works perfectly.

It currently looks like this in the JS file:

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!
]

Instead of it displaying a list of text (CNN for example, can I insert an image?

["<img src="images/1.jpg"/>, "http://www.dynamicdrive.com/"]

The above stops the drop down working completely.

Any help would be appreciated.

vwphillips
01-21-2011, 09:00 AM
var anylinkmenu2={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#FDD271', linktarget:'_new'} //Second menu variable. Same precaution.
anylinkmenu2.items=[
["<img src='http://www.vicsjavascripts.org.uk/StdImages/Egypt5.jpg' alt='Img' width='20' height='20' border='0' />", "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!
]

adam_design
01-21-2011, 12:56 PM
that's perfect many thanks for your guidance.