【发布时间】:2014-10-19 22:25:59
【问题描述】:
这是一个比之前提出的问题更复杂的问题,尝试使用之前给出的响应,但它不起作用。
这是代码
(function () {
function init() {
var speed = 330,
easing = mina.backout;
[].slice.call(document.querySelectorAll('.grid > a')).forEach(function (el) {
var s = Snap(el.querySelector('svg')), path = s.select('path'),
pathConfig = {
from: path.attr('d'),
to: el.getAttribute('data-path-hover')
};
el.addEventListener('mouseenter', function () {
path.animate({ 'path': pathConfig.to }, speed, easing);
});
el.addEventListener('mouseleave', function () {
path.animate({ 'path': pathConfig.from }, speed, easing);
});
});
}
init();
})();
【问题讨论】:
-
Array.prototype.slice.call( document.querySelectorAll('.grid > a') ) -
不幸的是,这不起作用 bencripps。它仍然抛出同样的错误。看看这个截图。 webpagescreenshot.info/i3/53fcb7f1d10883-60451702
-
你能创建一个jsfiddle吗?
-
jsfiddle 还不够。在 js/jquery-func.js 中查看 link。在 IE 8 或 IE 8 模式下检查。
标签: javascript arrays internet-explorer-8 call slice