WordPress Admin Bar Hover Effect

Discussion in 'CSS' started by IDocXD, Mar 13, 2012.

  1. #1
    Hey guys,

    I noticed the WP admin bar from when you are logged in and viewing you site at the top gets sort of weird looking and annoying to the design.
    So i came up with this small CSS snippet that works lovely in modern browsers, and also still works in most IE browsers, (only IE 9 tested).

    The Admin Bar will be invisible until hovered over it.

    Enjoy! :D

    
    /* WP-Admin Bar Hover Effect Start */
    
    /*
    *WP-Admin Bar Hover Effect
    *Author: IDocXD
    *Company: 69 Studios, Inc
    *URL: http:www.69studios.net
    */
    
    #wpadminbar{
        margin-top: -20px;
        opacity: 0; /* Can set to 0.2-0.4 so that can easily tell if you are logged in or not */
        z-index: 9999; /* Just a back-up z-index to make sure the admin bar never gets lost behind content */
        -webkit-transition: all 0.2s;
        -moz-transition: all 0.2s;
        -o-transition: all 0.2s;
        -ms-transition: all 0.2s;
        transition: all 0.2s;
    }
    
    #wpadminbar:hover{
        opacity: 1;
        margin-top: 0;
    }
    
    /* WP-Admin Bar Hover Effect End */
    
    Code (markup):

     
    IDocXD, Mar 13, 2012 IP
  2. wiicker95

    wiicker95 Well-Known Member

    Messages:
    438
    Likes Received:
    37
    Best Answers:
    10
    Trophy Points:
    100
    #2
    If you don't see anything before hovering, you won't know there's a toolbar unless you've installed the code yourself... I would put at least 20%, for opacity that is.
     
    wiicker95, Mar 14, 2012 IP
  3. IDocXD

    IDocXD Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    That is why there was a comment in the code stating:

    And yes the code has to be installed yourself.
     
    IDocXD, Mar 14, 2012 IP
  4. oliviershoek-consulting

    oliviershoek-consulting Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I turn off the worpress bar. It doesnt seem to work in my browser. There is just an empty space where it should be. So I go to 'edit my profile' and untick the option 'show toolbar' when viewing site. Problem solved.
     
    oliviershoek-consulting, Mar 16, 2012 IP