PDA

View Full Version : AnyLink CSS customisation for links



mikej
07-14-2009, 03:58 PM
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:
Looking to make the separate dropdown links a different colour from the others and to change some of the links to bold. Is there any way I can insert a css class into the links of the menucontent.js code to do this? For example:


anylinkmenu1.items=[
["Dynamic Drive", "http://www.dynamicdrive.com/", "class1"],
["CSS Drive", "http://www.cssdrive.com/","class2"],
["JavaScript Kit", "http://www.javascriptkit.com/","class3"]
]

Many thanks
Mike

ddadmin
07-14-2009, 08:53 PM
Sure, try the attached anylinkmenu.js file. Then inside menucontents.js where you wish to add a CSS class to a specific menu link, do the following:


anylinkmenu1.items=[
["Dynamic Drive", "http://www.dynamicdrive.com/", "", "extraclass"],
["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/"] //no comma following last entry!
]

Note how "extra" class is added as the 4th parameter, not the 3rd (which is reserved for "efc").