I am looking for a jQuery
plugin to expand div
elements so as to reveal their overflow (if any) on hover. Illustration:
The plugin should work on relatively positioned div
's (which I guess implies that you create a copy of the div
, set its positioning to absolute, then figure out where to place it).
Is there such a plugin already available out there?
You don't need a plugin. Just add proper css and use jQuery animate:
$div
.on('mouseenter', function(){
$(this).animate({ margin: -10, width: "+=20", height: "+=20" });
})
.on('mouseleave', function(){
$(this).animate({ margin: 0, width: "-=20", height: "-=20" });
})