Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: highlight title when in 'current' status.

  1. #1
    Join Date
    Dec 2010
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default highlight title when in 'current' status.

    1) Script Title: Glossy Accordion Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...enu-glossy.htm

    3) Describe problem:

    hi.
    i'm using this menu on the left sidebar of this page.
    i want to add different background color to menu's titles tabs when in 'current' page. i want it to have the same background it has when mouse-overing it...

    is there a way to do that ?

    thanks
    oren
    Last edited by orenlebbo; 07-03-2011 at 07:23 PM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Find the red in your html code, and add the rest in the following code:
    Code:
    	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
    		//do nothing
    		if(status == "block"){ //on open
    			header.className += " hover";
    		} else { //on close
    			header.className = header.className.substr(0, header.className.indexOf(" hover"));
    		}
    	}
    I haven't tested this out yet, but it should add a class "hover" when the menu is open, and take it away when it's not. So all you have to do is add a class hover to your css with the styling you want.
    Jeremy | jfein.net

  3. #3
    Join Date
    Dec 2010
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    thank you for your answer.
    i added the code but what happened is it colors all the titles in the same color.
    there's no 'current' effect... and the hover effect doesn't work to.. it resets all the cutomization i had before....
    you can see it here

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Okay, scratch that and change it to:
    Code:
    	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
    		//do nothing
    		if(status == "block"){ //on open
    			header.style.fontColor = "#???";
    		} else { //on close
    			header.style.fontColor = "#???";
    		}
    	}
    Change the blue to the color you want it when it opens, and the red when it coses.
    Jeremy | jfein.net

  5. #5
    Join Date
    Dec 2010
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    nope...
    now the menu is working well but no color changing when open/close...
    this is what i used:
    PHP Code:
    onopenclose:function(headerindexstateisuseractivated){ //custom code to run whenever a header is opened or closed
            //do nothing
        
    if(status == "block"){ //on open
                
    header.style.fontColor "#EC008C";
            } else { 
    //on close
                
    header.style.fontColor "#8E8E8E";
            }
        } 

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Stupid mistake, color not fontColor (my fault):
    Code:
    onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
            //do nothing
        if(status == "block"){ //on open
                header.style.color = "#EC008C";
            } else { //on close
                header.style.color = "#8E8E8E";
            }
        }
    Jeremy | jfein.net

  7. #7
    Join Date
    Dec 2010
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    still not...

  8. #8
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    It's .color not .Color
    Jeremy | jfein.net

  9. #9
    Join Date
    Dec 2010
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    still don't...
    and also now it cancelled the hover effect somehow...

  10. #10
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    This, I tested:
    Code:
    	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
    		//do nothing
    		header.style.color = (state == "none") ? "#8E8E8E" : "#EC008C";
    		header.onmouseover = function(){ this.style.color = "#EC008C"; }
    		header.onmouseout = function(){ this.style.color = "#8E8E8E"; }
    	}
    Jeremy | jfein.net

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
  •