Character count + input limitation plugin with jQuery

Like most web developers, over the years I’ve managed to amass a decent collection of functions and plugins that form part of my core javascript library for most projects I work on.

After writing character count functionality for several different projects I finally decided to turn it into a convenient reusable plugin.
Continue Reading

Combining jQuery’s addClass() + removeClass() attributes

A few times I’ve been in a situation where I’ve been working on a web application, or creating some custom form validation and for whatever reason I’ve needed to add and remove multiple CSS classes from a selector. Obviously jQuery has .addClass() and .removeClass() methods, both of which are invaluable in pretty much any jQuery project, but as a person who likes to keep code as concise as possible I still found it a little frustrating that I was having to add both attributes every time.
Continue Reading

Make your menu items fill the whole navigation bar

While going through client mock-ups with a fellow web designer we got onto the subject of making your top level navigation span across the entire width of the page. Personally I would normally be inclined to leave them a fixed width, left aligned, and not concern myself if there was white-space after the last item.  I do recall a long time ago running across this issue and at the time getting really frustrated by how something that seemed so simple was actually pretty difficult to achieve.
Continue Reading