JSFiddle - React, Tailwind, and code Playground
by GlauberRocha
HTML
<div>
<img src="http://www.cinematheque.fr/data/home/images/photo_batiment.jpg"/>
</div>
CSS
img {display: block; margin:36px;}
JavaScript
(function($) {
$.fn.over = function () {
return this.each(function () {
var
$this = $(this),
$parent = $this.parent(),
pos = $this.position(),
w = $this.width(),
h = $this.height();
$parent.css({position: "relative"});
$("<div style=\"position: absolute; top:" + pos.top + "px; left:" + pos.left + "px; width:" + w + "px; height:" + h + "px; border: solid 1px green;\"></div>").appendTo($parent);
});
};
}(jQuery));
$("img").over();