Results 1 to 3 of 3

Thread: Using images instead of text for AnyLink CSS anchors

  1. #1
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Using images instead of text for AnyLink CSS anchors

    1) AnyLink CSS Menu

    2) http://www.dynamicdrive.com/dynamici...anylinkcss.htm

    My URL: http://www.sullivanandco.com/test/pfp/test3.htm (only first item has a drop-down menu)

    3) I chose to modify this menu to work with images as anchors instead of text; used CSS to swap images. Brilliant so far. Only question: is there an easy way I can make the mouseover of the menu tell the header image to stay in "highlight" mode? Or should I use another script instead of the AnyLink one?

    Many thanks in advance!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here's a fairly easy method. Add only this to your current styles:

    Code:
    	ul#menu li a:hover, .activetrigger {background-position:0 -27px!important;}
    Then in the script add:

    Code:
    function dropdownmenu(obj, e, dropmenuID){
    if(dropdownmenu.last)
    dropdownmenu.last.className = '';
    dropdownmenu.last = obj;
    obj.className = 'activetrigger';
    if (window.event) event.cancelBubble=true
    else if (e.stopPropagation) e.stopPropagation()
    if (typeof dropmenuobj!="unde . . .
    and:

    Code:
    function delayhidemenu(){
    delayhide=setTimeout("dropmenuobj.style.visibility='hidden';dropdownmenu.last.className = '';",disappeardelay)
    }
    While you're at it, might as well take care of this minor error in the script too (add the red parts):

    Code:
    function showhide(obj, e, visible, hidden){
    if (ie5||ns6)
    dropmenuobj.style.left=dropmenuobj.style.top="-500px";
    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
    obj.visibility=visible
    else if (e.type=="click")
    obj.visibility=hidden
    }
    Last edited by jscheuer1; 08-03-2008 at 11:09 AM. Reason: add info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Fantastic; that worked a treat!

    Many thanks.

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
  •