Archive for May, 2010

My talk on AB testing at BDNT

On Tuesday I gave a 5 minute talk at the Boulder New Tech Meetup on the value and dangers of AB testing. It’s an area where I’ve made mistakes in the past and it was fun to share my perspective on the topic.

Here’s the entire video from the event.  I start talking around 19:22.

Thanks to Robert Reich for the opportunity to speak, Julie Penner for doing such a great job MCing at the last minute and to Dan Moore for linking me to the video.


Simple expandable menu with jQuery

I recently needed a nested and expandable navigation system (accordion style) for a project I was working on.  I took a look around at the existing jquery plugins and was surprised by the complexity of them. To me, there’s no reason for a simple menu to require 200 lines of JavaScript.  Thankfully jQuery makes it possible to pack a lot of punch into just a few lines of code.  While I recognize the other plugins offer more functionality, I wanted to show that these days it sometimes makes more sense to just roll your own solution. Not only does this solution cut down on the number of bytes that the user has to download, but you’ll also have code that is more concise and easier to maintain.

Click here to check out the demo and download the code

Here’s the jQuery magic that I came up with:

$(document).ready(function() {
    $(".menu").click(function(e) {
        // unhighlight the previous menu selection
        $(".menu .selected").removeClass("selected");
        // highlight the selected item & its parents

The HTML is a standard nested list and looks something like this:

<div class='menu'>
        <li><a href=''>My blog</a></li>
        <li><a href='#'>My profiles</a>
                <li><a href=''>Facebook</a></li>
                <li><a href=''>LinkedIn</a></li>
                <li><a href=''>Twitter</a></li>

And the CSS is easy to customize to match your own look and feel:

.menu {
.menu a {
.menu ul {
    border-top:1px solid #CCC;
.menu ul li {
    border-bottom:1px solid #CCC;
.menu ul li a {
.menu ul li a:hover, .menu ul li.selected a  {
/* nested items */
.menu ul li ul {
.menu ul li.selected ul {
.menu ul li.selected ul a {
    border-left:6px solid white;
.menu ul li ul li {
    border-bottom:1px solid white;
.menu ul li ul li:first-child {
    border-top:1px solid white;
.menu ul li.selected ul li.selected a, .menu ul li.selected ul li a:hover {
    border-left:6px solid #006363;

That’s it. Remember – guard your bytes!