2013-09-26 31 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地址,下載並舉辦自己的文件。