4343 return animationSupport ;
4444 } ,
4545 generate : function ( frameData ) {
46- var $elems , $frameStyle , css , frameName , property , key ;
46+ var $elems , $frameStyle , css , frameName , property , key ,
47+ prefix = $ . keyframe . getVendorPrefix ( ) ;
4748 frameName = frameData . name || "" ;
48- css = "@" + $ . keyframe . getVendorPrefix ( ) + "keyframes " + frameName + " {" ;
49+ css = "@" + prefix + "keyframes " + frameName + " {" ;
4950
5051 for ( key in frameData ) {
5152 if ( key !== "name" ) {
6162
6263 css = PrefixFree . prefixCSS ( css + "}" ) ;
6364
65+ css += css . replace ( $ . keyframe . getVendorPrefix ( ) , '' ) ;
66+
6467 $frameStyle = $ ( "style#" + frameData . name ) ;
6568
6669 if ( $frameStyle . length > 0 ) {
6770 $frameStyle . html ( css ) ;
6871
6972 $elems = $ ( "*" ) . filter ( function ( ) {
70- this . style [ "" + ( $ . keyframe . getVendorPrefix ( ) . slice ( 1 , - 1 ) ) + "AnimationName" ] === frameName ;
73+ return this . style [ "" + ( prefix . slice ( 1 , - 1 ) ) + "AnimationName" ] === frameName ||
74+ this . style [ "AnimationName" ] === frameName ;
7175 } ) ;
7276
7377 $elems . each ( function ( ) {
101105 playStateRunning = "running" ;
102106
103107 $ . fn . resetKeyframe = function ( callback ) {
104- var $el = $ ( this ) . css ( vendorPrefix + animationPlayState , playStateRunning ) . css ( vendorPrefix + "animation" , "none" ) ;
108+ var $el = $ ( this ) ,
109+ css = { } ;
110+
111+ css [ animationPlayState ] = css [ vendorPrefix + animationPlayState ] = playStateRunning ;
112+ css [ "animation" ] = css [ vendorPrefix + "animation" ] = "none" ;
113+
114+ $el . css ( css ) ;
105115
106116 if ( callback ) {
107117 setTimeout ( callback , 1 ) ;
108118 }
109119 } ;
110120
111121 $ . fn . pauseKeyframe = function ( ) {
112- var $el = $ ( this ) . css ( vendorPrefix + animationPlayState , "paused" ) ;
122+ var $el = $ ( this ) ,
123+ css = { } ;
124+ css [ animationPlayState ] = css [ vendorPrefix + animationPlayState ] = "paused" ;
125+ $el . css ( css ) ;
113126 } ;
114127
115128 $ . fn . resumeKeyframe = function ( ) {
116- return $ ( this ) . css ( vendorPrefix + animationPlayState , playStateRunning ) ;
129+ var $el = $ ( this ) ,
130+ css = { } ;
131+ css [ animationPlayState ] = css [ vendorPrefix + animationPlayState ] = playStateRunning ;
132+ return $el . css ( css ) ;
117133 } ;
118134
119135 $ . fn . playKeyframe = function ( frameOptions , callback ) {
148164 repeat = frameOptions . repeat ;
149165 animationcss = "" + frameOptions . name + " " + duration + "ms " + frameOptions . timingFunction + " " + delay + "ms " + repeat + " " + frameOptions . direction + " " + frameOptions . fillMode ;
150166 callback = frameOptions . complete ;
151- animationkey = vendorPrefix + "animation" ;
167+ animationkey = "animation" ;
152168 pfx = [ "webkit" , "moz" , "MS" , "o" , "" ] ;
153169
154170 var _prefixEvent = function ( element , type , callback ) {
167183 } ;
168184
169185 this . each ( function ( ) {
170- var $el = $ ( this ) . addClass ( "boostKeyframe" ) . css ( vendorPrefix + animationPlayState , playStateRunning ) . css ( animationkey , animationcss ) . data ( "keyframeOptions" , frameOptions ) ;
186+ var $el = $ ( this ) . addClass ( "boostKeyframe" ) . data ( "keyframeOptions" , frameOptions ) ,
187+ css = { } ;
188+
189+ css [ animationPlayState ] = css [ vendorPrefix + animationPlayState ] = playStateRunning ;
190+ css [ animationkey ] = css [ vendorPrefix + animationkey ] = animationcss ;
191+
192+ $el . css ( css ) ;
171193 if ( callback ) {
172194 _prefixEvent ( $el , 'AnimationIteration' , callback ) ;
173195 _prefixEvent ( $el , 'AnimationEnd' , callback ) ;
180202 id : "boost-keyframe"
181203 } ) . append ( " .boostKeyframe{" + vendorPrefix + "transform:scale3d(1,1,1);}" ) ;
182204
183- } ) . call ( this ) ;
205+ } ) . call ( this ) ;
0 commit comments