ie8在动态添加视频/音频标签时出现问题

时间:2014-04-08 15:36:10

标签: mediaelement.js

当页面加载时,我使用javascript和jquery添加一组标签,然后在它出现时立即调用el.mediaelementplayer()(在我的情况下,我使用somenode.replaceWith(el)。

到目前为止,这适用于所有浏览器。然而,当我遇到" next"再次运行代码的按钮,我在ie8上得到错误:

$ node.css(...)为null或不是对象:mediaelement-and-player.js中的第2696行。这是相应的一行:

// detect 100% mode - use currentStyle for IE since css() doesn't return percentages
if (t.height.toString().indexOf('%') > 0 || t.$node.css('max-width') === '100%' || parseInt(t.$node.css('max-width').replace(/px/,''), 10) / t.$node.offsetParent().width() === 1 || (t.$node[0].currentStyle && t.$node[0].currentStyle.maxWidth === '100%')) {

0 个答案:

没有答案
相关问题