Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET jQuery
Hi Friends,
 
I am implements Image cropping functionality using jquery image crop.
jquery crop image functionality working fine Chrome, Mozilla,safari. IE9 browser also working but only localhost. after publish and upload into production server. now not working image cropping only IE browser and doesn't show any error in IE browser Console.
 
how to solve my error.? please help me..?
 
my Jquery script like
<script type="text/javascript">
jQuery(function ($) {
    // To hold the API and image size.
    var jcrop_api, boundx, boundy;
    $('.cropView').Jcrop(
        {
            // img_crop is the ID of image control
            onChange: updatePreview, // will display the selected img on change.
            onSelect: updatePreview, // will display the selected img Img_preview
            onSelect: storeCoords, // will tell the coordinates
            aspectRatio: 1,
            bgOpacity: .4,
            setSelect: [400, 400, 200, 200],
            aspectRatio: 1,
            // maxSize: [300, 300],
            minSize: [200, 200],
            display: 'block'
        }, 
        function () {
            var bounds = this.getBounds();
            boundx = bounds[0];
            boundy = bounds[1];
            jcrop_api = this;
        });
 
        function updatePreview(c) {
            if (parseInt(c.w) > 0) {
                var rx = 100 / c.w;
                var ry = 100 / c.h;
                $('.cropped').css({  //Img_preview is the ID of image control
                    width: Math.round(rx * boundx) + 'px',
                    height: Math.round(ry * boundy) + 'px',
                    marginLeft: '-' + Math.round(rx * c.x) + 'px',
                    marginTop: '-' + Math.round(ry * c.y) + 'px',
                    display: 'none'
                });
        }
    };
});
// will store the selected part the images coordinates
//             
function storeCoords(c) {
    jQuery('#ContentPlaceHolder1_X').val(c.x);  // X of the hidden field
    jQuery('#ContentPlaceHolder1_Y').val(c.y);  // Y of the hidden field
    jQuery('#ContentPlaceHolder1_W').val(c.w);  // W of the hidden field
    jQuery('#ContentPlaceHolder1_H').val(c.h);  // H of the hidden field
};
</script>
 
<link href="../css/jquery.Jcrop.css" rel="stylesheet" type="text/css" /> 
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script> 
<script src="../js/jquery.Jcrop_.min_.js" type="text/javascript"></script>
thanks and regards
Posted 30-Apr-13 1:05am
Edited 30-Apr-13 1:30am
(no name)47.6K
v2
Comments
Edo Tzumer at 30-Apr-13 7:41am
   
Quite a handful of things not working properly on IE ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 515
1 Maciej Los 349
2 Richard MacCutchan 220
3 BillWoodruff 209
4 Mathew Soji 160
0 OriginalGriff 8,654
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,229
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 30 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100