Multiple images in a div

21 views
Skip to first unread message

Shravan

unread,
May 9, 2011, 4:56:01 PM5/9/11
to javascript-image-cropper-ui
Hi,
I just tried out cropper and it seems fantastic.
However I noticed something weird.

If I have 2 images, image1 and image2, inside a div tag and attach
cropper onto image1 on some event (say a button click), the images
change their order(image1 comes after image2 after attaching cropper)

I have added some of the sample code below. Deeply appreciate any
help.


<script type="text/javascript" charset="utf-8">
// setup the callback function
function onEndCrop( coords, dimensions ) {

}

function lasso()
{
var temp = new Cropper.Img( 'testImage',
{
onEndCrop:
onEndCrop
}
);
}

<h2 onclick="lasso()">Basic cropper test</h2>
<p>
Some test content before the image
</p>

<div id="testWrap">
<img src="castle.jpg" alt="test image" id="testImage" width="500"
height="333" />
<img src="castle.jpg" alt="test image" id="testImage" width="700"
height="433" />
</div>

Blasting

unread,
May 11, 2011, 8:46:36 PM5/11/11
to javascript-image-cropper-ui
Actually, someone already pointed out the easiest solution is to avoid
this case totally and wrap each image on its on div
Reply all
Reply to author
Forward
0 new messages