[wp-trac] [WordPress Trac] #19994: Sticky admin menu

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 29 12:15:21 UTC 2012


#19994: Sticky admin menu
-------------------------+----------------------
 Reporter:  tillkruess   |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  UI           |     Version:  3.3.1
 Severity:  normal       |  Resolution:  wontfix
 Keywords:               |
-------------------------+----------------------

Comment (by arleym):

 You can do this with a single media query (using vertically oriented
 responsive web design) if you know what the height will be. I think the
 jQuery function below is even better as it can take into account as many
 extra plugin items in the nav as any user could ever have.

 2 demos and the code are explained in this CSS Tricks post: http://css-
 tricks.com/responsive-web-above-the-fold/




 {{{
 var setResponsive = function () {

   // Is the window taller than the #adminmenuwrap by 50px or more?
   if ($(window).height() > $("#adminmenuwrap").height() + 50) {

      // ...if so, make the #adminmenuwrap fixed
      $('#adminmenuwrap').css('position', 'fixed');

   } else {

      //...otherwise, leave it relative
      $('#adminmenuwrap').css('position', 'relative');

   }

 }

 $(window).resize(setResponsive);
 setResponsive();
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19994#comment:18>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list