首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jquery旋转插件IE7

Jquery旋转插件IE7
EN

Stack Overflow用户
提问于 2012-05-28 23:39:28
回答 1查看 1.3K关注 0票数 0

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

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

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

代码语言:javascript
复制
_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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-05-29 01:03:32

这是该插件的文档问题之一。

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

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

尝试替换第~132行

代码语言:javascript
复制
 this._img.parentNode.removeChild(this._img);//replace this...

 jQuery(this._img).parent().find(this._img).remove();// with this
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10787168

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档