Jquery旋转插件IE7

时间:2012-05-28 15:39:28

标签: jquery jquery-plugins internet-explorer-7

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

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

SCRIPT5007:无法获取属性“removeChild”的值:object为null或undefined

_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

1 个答案:

答案 0 :(得分: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
相关问题