a better solution might be:
$('#floorplans a:has(img)').attr('rel', 'lightbox[floorplans]');
why is it better?
Guffa's solution will select all the images inside the anchors in the jQuery set (which can be a big overkill if you have a large number of images per page).
My solution will only select the specified bindings, not images.
source share