【问题标题】:Jquery Rotate Plugin IE7jQuery 旋转插件 IE7
【发布时间】:2012-05-28 15:39:27
【问题描述】:

我正在使用 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

【问题讨论】:

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


    【解决方案1】:

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

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-14
      • 1970-01-01
      • 1970-01-01
      • 2011-12-06
      相关资源
      最近更新 更多