Entries tagged with ‘JavaScript’

Text input example text with jQuery

When filling out a form on the web, it isn’t always crystal clear what you are supposed to type into every text input field. Since a confusing form is a form that is less likely to be completed, it is critical to provide help wherever important. In these cases, it can be very helpful to […]

ColorFlashing with jQuery Enchant

Widgets, buttons, and doodads are always vying for one's attention. So, if something is very important, what options does a developer have that will effectively and unobtrusively grab the user's focus?

Automatic Pull-quotes with Behaviour and CSS

Our new favorite toy around here is automatic pull-quotes using Javascript and CSS. We wanted an elegant and aesthetically pleasing way to add interest, gravitas, and improve the scannability of some of our pages, especially when an image is unavailable or inappropriate. After a little digging around, we discovered that Roger Johansson at 456 Berea […]

Shaun Inman’s Widon’t Ported to Javascript

I was working on some pull-quote magic today (more on that later) and needed to de-widow a string in Javascript a la Shaun Inman’s Widon’t. So I ported it to Javascript. Here’s the magic: String.prototype.widont = function() { return this.replace(/([^\s])\s+([^\s]+)\s*$/, '$1 $2'); } // end widont() To use this simply call the widont() method on a […]