【问题标题】:jcrop is not working on internet explorer 8jcrop 不适用于 Internet Explorer 8
【发布时间】: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

标签: internet-explorer-8 jcrop


【解决方案1】:

您的代码看起来不错,只有一件事!不应在 aspectRatio 十进制值周围使用 ''。

Jcrop Demo 可以在 IE8 上运行,对吧?

也许你应该试试Cropzoom。我在一个商业项目中使用了它,经过一些调整后,它在 IE7+、FF 和 Safari 等中非常适合我们......

【讨论】:

    猜你喜欢
    • 2011-12-09
    • 1970-01-01
    • 1970-01-01
    • 2013-07-25
    • 1970-01-01
    • 1970-01-01
    • 2020-06-05
    • 2015-07-01
    • 2013-07-05
    相关资源
    最近更新 更多