Jcrop IE8无法正常工作(Jcrop IE8 not work)
我的jCrop有问题。 他在其他浏览器中的funcuina但不在IE8中工作。 我找不到问题。 如果是图像数据的问题或不允许裁剪的图像尺寸。 有人可以帮忙吗?
<script type="text/javascript"> jQuery(document).ready(function () { // Create variables (in this scope) to hold the API and image size var jcrop_api, boundx, boundy; var $targetImage = jQuery('.targetImage'), targetImageDOM = $targetImage[0]; var carregarJcrop = function () { $targetImage.Jcrop({ onChange: updatePreview, onSelect: updatePreview, aspectRatio: 1 }, function () { // Use the API to get the real image size var bounds = this.getBounds(); boundx = bounds[0]; boundy = bounds[1]; // Store the API in the jcrop_api variable jcrop_api = this; }); function updatePreview(c) { if (parseInt(c.w) > 0) { var rx = 231 / c.w; var ry = 231 / c.h; jQuery('#x').val(c.x); jQuery('#y').val(c.y); jQuery('#w').val(c.w); jQuery('#h').val(c.h); jQuery('.jcrop-preview').css({ 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' }); } }; }; var checaCarregamento = function () { if (targetImageDOM.complete) { carregarJcrop() } else { setTimeout(checaCarregamento, 500); } }; if ($targetImage.length > 0) setTimeout(checaCarregamento, 500); });I have a problem with jCrop. He funcuina in other browsers but not working in IE8. I can not find the problem. If it is a problem of image data or the image size that does not allow the crop. Can someone help??
<script type="text/javascript"> jQuery(document).ready(function () { // Create variables (in this scope) to hold the API and image size var jcrop_api, boundx, boundy; var $targetImage = jQuery('.targetImage'), targetImageDOM = $targetImage[0]; var carregarJcrop = function () { $targetImage.Jcrop({ onChange: updatePreview, onSelect: updatePreview, aspectRatio: 1 }, function () { // Use the API to get the real image size var bounds = this.getBounds(); boundx = bounds[0]; boundy = bounds[1]; // Store the API in the jcrop_api variable jcrop_api = this; }); function updatePreview(c) { if (parseInt(c.w) > 0) { var rx = 231 / c.w; var ry = 231 / c.h; jQuery('#x').val(c.x); jQuery('#y').val(c.y); jQuery('#w').val(c.w); jQuery('#h').val(c.h); jQuery('.jcrop-preview').css({ 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' }); } }; }; var checaCarregamento = function () { if (targetImageDOM.complete) { carregarJcrop() } else { setTimeout(checaCarregamento, 500); } }; if ($targetImage.length > 0) setTimeout(checaCarregamento, 500); });最满意答案
你使用的是最新版本吗? 似乎有一个IE8修复:
IE 8修复
Are you using the latest version? Seems there is an IE8 fix:
IE 8 Fix
更多推荐
function,jQuery,var,image,电脑培训,计算机培训,IT培训"/> <meta name="des
发布评论