0

我正在使用 Jquery 插件 Rotate v2.2。http://code.google.com/p/jqueryrotate/

在 IE7 中,我看到以下错误。

SCRIPT5007:无法获取属性“removeChild”的值:对象为空或未定义

_Loader:(function()
    {
        if (IE)
        return function()
        {
            var width=this._img.width;
            var height=this._img.height;
            this._img.parentNode.removeChild(this._img); ***//Error Here***

            this._vimage = this.createVMLNode('image');
            this._vimage.src=this._img.src;
            this._vimage.style.height=height+"px";
            this._vimage.style.width=width+"px";
            this._vimage.style.position="absolute"; // FIXES IE PROBLEM - its only rendered if its on absolute position!
            this._vimage.style.top = "0px";
            this._vimage.style.left = "0px";

            /* Group minifying a small 1px precision problem when rotating object */
            this._container =  this.createVMLNode('group');
            this._container.style.width=width;
            this._container.style.height=height;
            this._container.style.position="absolute";
            this._container.setAttribute('coordsize',width-1+','+(height-1)); // This -1, -1 trying to fix that ugly problem
            this._container.appendChild(this._vimage);

            this._temp.appendChild(this._container);
            this._temp.style.position="relative"; // FIXES IE PROBLEM
            this._temp.style.width=width+"px";
            this._temp.style.height=height+"px";
            this._temp.setAttribute('id',this._parameters.id);
            this._temp.className=this._parameters.className;            

            this._BindEvents(this._temp,this._parameters.bind);
            _finally.call(this);

        }
        else
4

1 回答 1

0

这是插件的记录问题之一。

http://code.google.com/p/jqueryrotate/issues/detail?id=31&q=remove

建议的唯一解决方法如下:

尝试更换线〜132

 this._img.parentNode.removeChild(this._img);//replace this...

 jQuery(this._img).parent().find(this._img).remove();// with this
于 2012-05-28T17:03:32.010 回答