I am trying to use jcrop
I have this at the top of my page
<script src="http://studiga.delta-xray.co.uk/sites/all/modules/add_property/js/jquery.min.js?o2190n"></script>
<script src="http://studiga.delta-xray.co.uk/sites/all/modules/add_property/js/jquery.Jcrop.min.js?o2190n"></script>
<script src="http://studiga.delta-xray.co.uk/sites/all/modules/add_property/js/crop.js?o2190n"></script>
I have this in my page
<input onchange="JavaScript: fileSelectHandler1();" type="file" id="browse_file1" name="browse_file1" size="60" class="form-file" />
<img name="image1" id="image1" src="" alt="">
- function fileSelectHandler1() {
- // get selected file
- var oFile = $('#browse_file1')[0].files[0];
- // hide all errors
- $('.error').hide();
- // check for image type (jpg and png are allowed)
- var rFilter = /^(image\/jpeg|image\/png)$/i;
- if (! rFilter.test(oFile.type)) {
- $('.error').html('Please select a valid image file (jpg and png are allowed)').show();
- return;
- }
- // check for file size
- if (oFile.size > 250 * 1024) {
- $('.error').html('You have selected too big file, please select a one smaller image file').show();
- return;
- }
- // preview element
- var oImage = document.getElementById('image1');
- // prepare HTML5 FileReader
- var oReader = new FileReader();
- oReader.onload = function(e) {
-
- // e.target.result contains the DataURL which we can use as a source of the image
- oImage.src = e.target.result;
- oImage.onload = function () { // onload event handler
-
- // display step 2
- $('.step2').fadeIn(500);
-
- // display some basic image info
- var sResultFileSize = bytesToSize(oFile.size);
- $('#filesize').val(sResultFileSize);
- $('#filetype').val(oFile.type);
- $('#filedim').val(oImage.naturalWidth + ' x ' + oImage.naturalHeight);
-
- // destroy Jcrop if it is existed
- if (typeof jcrop_api != 'undefined') {
- jcrop_api.destroy();
- jcrop_api = null;
- $('#image1').width(oImage.naturalWidth);
- $('#image1').height(oImage.naturalHeight);
- }
- setTimeout(function(){
- // initialize Jcrop
- $('#image1').Jcrop({
etc
But I am getting
Uncaught TypeError: $(...).Jcrop is not a function
when it gets to
$('#image1').Jcrop({ and I have no idea why
Thanks