19
19
iconcolor : '#999' ,
20
20
border : 'default' ,
21
21
complete : null ,
22
- bordersize : 10
22
+ bordersize : 10 ,
23
+ delay : 0
23
24
} , options ) ;
24
25
25
26
return this . each ( function ( ) {
26
27
27
- var customSettings = [ "fgcolor" , "bgcolor" , "fill" , "width" , "dimension" , "fontsize" , "animationstep" , "endPercent" , "icon" , "iconcolor" , "iconsize" , "border" , "startdegree" , "bordersize" ] ;
28
+ var customSettings = [ "fgcolor" , "bgcolor" , "fill" , "width" , "dimension" , "fontsize" , "animationstep" , "endPercent" , "icon" , "iconcolor" , "iconsize" , "border" , "startdegree" , "bordersize" , "delay" ] ;
28
29
29
30
var customSettingsObj = { } ;
30
31
var icon = '' ;
130
131
var type = '' ;
131
132
var fireCallback = true ;
132
133
var additionalAngelPI = ( customSettingsObj . startdegree / 180 ) * Math . PI ;
134
+ var animationDelay = customSettingsObj . delay ;
133
135
134
136
if ( $ ( this ) . data ( 'type' ) != undefined ) {
135
137
type = $ ( this ) . data ( 'type' ) ;
141
143
quart = Math . PI / 0.996 ;
142
144
}
143
145
}
144
-
146
+
145
147
if ( $ ( this ) . data ( 'type' ) != undefined ) {
146
148
type = $ ( this ) . data ( 'type' ) ;
147
149
183
185
. appendTo ( obj )
184
186
. addClass ( 'circle-info-half' )
185
187
. css (
186
- 'line-height' , ( customSettingsObj . dimension * factor ) + 'px'
187
- )
188
+ 'line-height' , ( customSettingsObj . dimension * factor ) + 'px'
189
+ )
188
190
. text ( info ) ;
189
191
}
190
192
207
209
}
208
210
209
211
/**
210
- * animate foreground circle
211
- * @param current
212
+ * draw background circle
212
213
*/
213
- function animate ( current ) {
214
-
214
+ function bgrCircle ( ) {
215
215
context . clearRect ( 0 , 0 , canvas . width , canvas . height ) ;
216
216
217
217
context . beginPath ( ) ;
227
227
context . fill ( ) ;
228
228
}
229
229
230
+ }
231
+
232
+ /**
233
+ * animate foreground circle
234
+ * @param current
235
+ */
236
+ function animate ( current ) {
237
+
238
+
230
239
context . beginPath ( ) ;
231
240
context . arc ( x , y , radius , - ( quart ) + additionalAngelPI , ( ( circ ) * current ) - quart + additionalAngelPI , false ) ;
232
241
255
264
}
256
265
}
257
266
258
- animate ( curPerc / 100 ) ;
267
+ bgrCircle ( ) ;
268
+
269
+ setTimeout ( function ( ) {
270
+ animate ( curPerc / 100 ) ;
271
+ } , animationDelay ) ;
259
272
273
+ console . log ( animationDelay ) ;
260
274
} ) ;
261
275
} ;
262
- } ( jQuery ) ) ;
276
+ } ( jQuery ) ) ;
0 commit comments