Simple jQuery Refactoring

I’ve learned so much about jQuery while working at Viget. I wrote a blog post about how you can improve your jQuery through some simple refactoring.

Visit Site →

1 Comment

Emil

01.16.2011

Here is my 2 cents

$(’#nav>li>a’).click(function(e){
e.preventDefault();
$(’#nav>.current>a’).add(this).parent().toggleClass(‘current’).children(‘ul’).slideToggle(250);
});

Too late, comments are closed!

Don’t worry, you can email me or contact me on Twitter.