The New York Times Navigation Bar Could be Improved

The navigation bar on The New York Times website doesn't look finished. I'm sure I'm not the first to notice this, but it hasn't changed since they launched the new site a few months ago. So, I took a stab at improving it.

The Setup

When you visit The New York Times website, the navigation bar is 155px below the top, centered horizontally, and 28px tall. When the navigation bar reaches the top of the window (after scrolling), it becomes anchored to the top.

The Problem

At this point, the navigation's layout changes dramatically. Two new items are added to the left and one is removed from the right. On top of that, the navigation items become left aligned and the bar becomes taller.

But there's no transition. Jarring is the first word that comes to mind. Here's a quick video that demonstrates the issue.

The Solution

I'm going to assume that the differences between the two versions of the navigation are absolutely necessary. That being said, it wouldn't be hard to add some transitions to soften the jarring switch.

I think the new navigation items should fade in, and the existing ones should glide to the left.

I've quickly thrown together a demo of how I'd hope The Times would improve their menu. Give it a try, I think it's a huge improvement. Is my version perfect? Of course not, I hacked it together on a Saturday morning while "watching" my nine month old.

But it's a start.


Just wanted to address some comments I've gotten.

  1. Yes, I know this doesn't work great in mobile. This solution is for The Times desktop site. Even so, it'd be easy enough to come up with a complete solution.
  2. I've (mostly) fixed the demo in FireFox
  3. How'd I do it? With CSS3 transitions and a little JavaScript to calculate the width of the menu items. This wouldn't work for older browsers. But, since we're leaving the markup as is, older browsers would just continue to work in the current fashion, and modern browsers would work better. Check out the source of the demo for the details, but for those interested, I've included the pertinent transition code below.


<div id="container">
<h1>New York Times</h1>
<div class="menu">
<li class="icon hamburger">&nbsp;</li>
<li class="icon search">&nbsp;</li>
<li>New York</li>
<li>Fashion &amp; Style</li>
<div class="content">


$(window).bind('scroll', function() {
if ($(window).scrollTop() > 119) {
var width = 50;
$('.menu UL LI').each(function(index, el){
width += $(el).width() + 4;
$('.menu UL').css('width', width + 'px');
} else {
$('.menu UL').css('width', '942px');


.menu {
transition: padding 100ms linear;
-webkit-transition: padding 100ms linear;


.scrolled .menu {
position: fixed;
padding-bottom: 8px;

.menu UL {
transition: width 100ms linear;
-webkit-transition: width 100ms linear;
.menu UL LI.icon {
visibility: hidden;
float: left;
transition: visibility 250ms linear;
.menu UL LI.icon.hamburger {
background: url('/nytimes/hamburger.png') no-repeat 0 -7;
.menu UL {
background: url('/nytimes/search.png') no-repeat 0 -7;
.scrolled .menu UL LI.icon {