This jQuery plugin offers a very basic box-model overlay via CSS. When an element is hovered, appropriate margin/border/padding/content overlay boxes are displayed, in a similar manner to Firebug’s ‘Box model shading’. Whilst the Firebug approach is useful for design debugging, jquery.overlay comes in handy for CSS tutorials and demonstrations. For a practical example, see the ‘Margin after float’ article.
To enable an element to display its overlay on hover:
$('div').overlay();
To add a ‘static’ overlay (like the one at the top of this page):
add_overlay('div');
Get it from github here.
Thu 22 Jul 2010 21:21
Jason said:
You’re a flipping legend mate. This is great. Exactly what I was looking for!