我知道我的问题是已知的,但我只是想不出解决问题的方法。 然而,代码在 chrome、ff 和 safari 中有效,但在 ie6-8 中无效。 我尝试调试代码并弹出以下内容: 行:272 错误:对象不支持此属性或方法
这是我的 js 文件中的第 272 行
$('#page1')[0].addEventListener('webkitAnimationEnd', self.webkitAnimationEnd, true);
你知道它有什么问题吗?我正在使用 jquery <script type="text/javascript" src="js/jquery-1.4.3.min.js">;</script>
在我的 .html 文件中调用。
我感谢任何帮助或有用的提示。 提前谢谢你。
最佳答案
See mozilla docs for problem description and solution
var el = $('#page1')[0];
if (el.addEventListener){
el.addEventListener('webkitAnimationEnd', self.webkitAnimationEnd, true);
} else if (el.attachEvent){
el.attachEvent('webkitAnimationEnd', self.webkitAnimationEnd);
}
关于javascript - IE8 : Object doesn't support this property or method,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7531462/