2013-09-26 40 views
2

我的div有一个onclick功能,我的CSS有一个WebKit的翻译动画我怎样才能点击与CSS动画的div?

<div class="ant animate" onclick="myFunction()"> </div> 

我的剧本有一个控制台日志,但不会触发

.animate{ 
    -webkit-animation: food 30s linear infinite; 

} 
.ant { 
    width: 90px; 
    height: 90px; 
    background:black; 
    pointer-events: none; 
    z-index: 3000 
} 


@-webkit-keyframes food { 
    0% { 
    -webkit-transform: translate(0px,1000px); 
    } 
    100% { 
    -webkit-transform: translate(0px,-1000px); 

    } 
} 

我plnk类似,但使用jQuery http://plnkr.co/edit/Qv1T4t9thBj8EIpdJUSH

如果我解除绑定我的动画这个点击完美

+0

看起来像我们的代码工程..检查plnkr - http://plnkr.co/edit/HjQXM7kIjgyOGpeYHCfe –

+0

这不适合我,我浏览谷歌浏览器30.0.1599.59测试版。问题仍然存在 – geronimo76

+0

在Safari浏览器中运行......移动和警报。不适用于铬... –

回答

0

警报出现我n最新版本的Firefox和safari。

该运动在safari中运行,chrome但不在firefox中运行。

在Chrome中我得到以下错误:

Refused to execute script from 
    'https://raw.github.com/furf/jquery-ui-touch-punch/ 
    master/jquery.ui.touch-punch.js' 
    because its MIME type ('text/plain') is not executable, 
    and strict MIME type checking is enabled. 

我想说的不是链接到raw.github地址,下载并举办自己的文件。

相关问题