JSFiddle - React, Tailwind, and code Playground

by axtruo

HTML

<button>add image</button>
<div id="currentimage">
    <img src="http://s25.postimg.org/v554s2umn/man_looking_at_sunset.jpg" width="400px" style="height: auto; z-index: 0;" />
</div>

CSS

#currentimage {
    position: relative;
}

 #currentimage img {
    position: absolute;
    top:0;
    left:0;
}

JavaScript

$(document).ready(function () {
    $("button").click(function () {
        $("#currentimage").append('<img id="dragable" src="http://s25.postimg.org/pi8ruls3z/image.jpg" width="200px" height="auto" />');
        $("#dragable").draggable();
      // i am tring that this dragable image must be above background image
    });
});