Abstraktion · User interface design, CMS driven website development, eCommerce, PHP, Django and Rails specialists

We design & build creative, usable, technically outstanding web applications for great clients.

Some nifty jQuery snippets

By Chris Garrett on Monday 7th December 2009 · No Comments · Tags: ,

An example of label_to_value

label_to_value

There are always situations where it’s required to store what should be an <input />’s label as it’s value. This can be a real headache to make accessible and to ensure graceful degradation, so I wrote a quick reusable function which grabs the content of a label bound to an input with the “for” attribute and appends it as the <input />’s “value” attribute. It then hides the label.

An example of make_gallery

make_gallery

If you’ve got a group of <img />’s, simply call “make_gallery()” on them to collapse them into a paginated gallery, like on our portfolio pages.

overlay_tooltips

A very barebones tooltips implementation, reliant on additional CSS styling. Just call “overlay_tooltips(child)” on an object, where child is the element who’s content you want to display in the tooltip.

Leave a Reply