Jcrop plugin does not work with resize function

My Jcrop plugin is not working properly.

I can select the area to crop, but there are no size squares at the edges. I do not know if this is a specific function or a default value.

Here is what I mean. My crop area is as follows:

my picture

My crop background is red and the selected area has the original color, but it’s strange that there are no size squares in this image:

good picture

My code is as follows:

Head:

<head> <title>Het Vergeet-mij-nietje</title> <script type="text/javascript" src="js/showfunctie.js"></script> <script src="js/jquery.min.js"></script> <script src="js/jquery.Jcrop.min.js"></script> <link rel="stylesheet" href="style/css/demos.css" type="text/css" /> <script language="Javascript"> jQuery(function($){ var jcrop_api; $('#cropbox').Jcrop({ bgColor: 'red' },function(){ jcrop_api = this; }); $('#animbutton').click(function(e){ jcrop_api.animateTo([ 120,120,80,80 ]); return false; }); $('#delselect').click(function(e){ jcrop_api.release(); return false; }); }); </script> </head> 

My image code:

  <div id="content1"> <?php $target = "uploads/"; $target = $_POST["imagesource"]; $target = $target . basename( $_FILES['filename']['name']) ; $ok=1; if(move_uploaded_file($_FILES['filename']['tmp_name'], $target)) { echo "De afbeelding *". basename( $_FILES['filename']['name']). "* is geupload naar de map 'uploads'"; } else { echo "Sorry, er is een probleem met het uploaden van de afbeelding."; } ?> <br /> <br /> <img id="cropbox" src="<?php echo $target ?>" width="400px" /> <br /> <br /> </div> 

Hope someone knows what the problem is :)

+4
source share
1 answer

Have you looked at this JCrop style example? maybe this is a CSS issue?

Do you have a live example of your code?

+5
source

Source: https://habr.com/ru/post/1447580/


All Articles