Results 1 to 2 of 2

Thread: AnyLink CSS customisation for links

  1. #1
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default AnyLink CSS customisation for links

    1) Script Title: AnyLink JS Drop Down Menu v2.2

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pmenuindex.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:

    Code:
    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

  2. #2
    Join Date
    Aug 2004
    Posts
    9,890
    Thanks
    3
    Thanked 964 Times in 953 Posts
    Blog Entries
    15

    Default

    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:

    Code:
    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").
    DD Admin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •