【发布时间】:2012-08-06 14:50:56
【问题描述】:
我正在使用 Jcrop 在我的网络应用程序中裁剪图像。它适用于除 IE8 之外的所有浏览器(IE9、FF、Chrome、Safari)。具体来说,Windows 7 附带的 8.7.6。
我正在使用 Jcrop v 0.9.9。
在 Firefox 中它可以工作。我看到一个类似于 DOM 的结构
img id... "style="display:none"
div class="jcrop-holder" ......
.........................
img ........
div
在 IE 8.7.6 中,我看到的 DOM 像
img id... "style="display:none"
----空白-----
基本上,jcrop-holder 不会被注入到 DOM 中,而原始图像就像其他浏览器一样被隐藏。
你能请。对此有所了解?如果您知道 IE 的任何解决方法。
感谢您的帮助。
将 jcrop 附加到目标图像的 Javascript 代码
function attachJcropToModal()
{
jQuery(function($)
{
$('#jcrop_target').Jcrop(
{
aspectRatio: '<%=defaultAspectRatioValue%>',
minSize: [0,0],
onChange: updateCoords,
onSelect: updateCoords
},
function ()
{
jcrop_api = this;
}
);
});
}
function updateCoords(c)
{
$('#w').val(Math.round(c.w*adjFactor));
$('#h').val(Math.round(c.h*adjFactor));
$('#x1').val(Math.round(c.x*adjFactor));
$('#y1').val(Math.round(c.y*adjFactor));
}
Html图片显示代码
<div class="cropperContainer">
<table>
<tbody><tr>
<td class="main">
<img id="jcrop_target" src="<%=imgSourceURL%>"<%=overriddenImageWidthAttr%> alt="" />
</td>
</tr>
</tbody></table>
</div>
【问题讨论】:
-
更多关于您的 html 和脚本代码的信息会很棒。
-
Nikolaj,我刚刚添加了脚本和html