IE8中的jquery错误:'Object'不支持此属性或方法

val*_*any 2 jquery internet-explorer-8

我做了类似的事情:http: //tympanus.net/codrops/2012/01/04/thumbnail-proximity-effect/就像原版它在FF,Safarei中工作...但是我在IE 8中得到了错误/ 7(不确定9).

因为我对JD和jQuery非常陌生,所以我不知道为什么会发生这种情况.有人可以帮忙吗?

调试器将其跟踪到此块:

_getScaleVal= function() {              
                        var st = window.getComputedStyle($jelems.get(0), null),
                            tr = st.getPropertyValue("-webkit-transform") || 
                                st.getPropertyValue("-moz-transform") || 
                                st.getPropertyValue("-ms-transform") || 
                                st.getPropertyValue("-o-transform") || 
                                st.getPropertyValue("transform") || 
                                "fail...";

                        if( tr !== 'none' ) {    

                            var values = tr.split('(')[1].split(')')[0].split(','),
                                a = values[0],
                                b = values[1],
                                c = values[2],
                                d = values[3];

                            return Math.sqrt( a * a + b * b );

                             }

                    },
Run Code Online (Sandbox Code Playgroud)

调试器抱怨这些问题:

第2行Char 8:Object不支持此属性或方法

第3行第9行:'undefined'为null或不是对象

第18行字符9:'undefined'为null或不是对象

第19行字符10:'0'为空或不是对象

第20行第10行:'1'为空或不是对象

第21行字符10:'2'为空或不是对象

第22行字符10:'3'为空或不是对象

非常感谢您的投入!!

Den*_*ret 9

在版本9之前,IE上没有getComputedStyle.

在互联网上有修复,就像这个(未经我测试).