Hi,
i want to crop an image that i upload, then the image appears behind a div where i drag and choose what i want and crop it. Here's what i want after the upload:
the black background is the background-color of the body, the image inside the red border is what i want to crop.
Here's the code i have (without the upload of the image):
<style>
body{margin:0; padding:0; background-color:#000;}
.demo{margin:auto; width:600px; z-index:-10;}
.draggable { width: 90px; height: 90px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
#containment-wrapper { width: 95%; height:150px; border:2px solid #ccc; padding: 10px; z-index:10;}
#draggable4{border:none; background:none; z-index:-1;}
#square{border:2px solid #FFF; z-index:-10;}
</style>
<script>
$(function() {
$( "#draggable" ).draggable({ axis: "y" });
$( "#draggable2" ).draggable({ axis: "x" });
$( "#draggable3" ).draggable({ containment: "#containment-wrapper", scroll: false });
$( "#draggable4" ).draggable({ containment: "#demo-frame" });
$( "#draggable5" ).draggable({ containment: "parent" });
});
</script>
</head>
<body>
<div id="square">
<div class="demo">
<div id="containment-wrapper">
<div id="draggable4" class="draggable ui-widget-content">
<img src="../images/img.jpg" width="800" />
</div>
</div>
</div><!-- End demo -->
</div>
</body>
My problem is that i can't put the image in front of the div #demo and behind the #square.
Hope you can help me.
Thank you,
PF2G