| | 271 | |
|---|
| | 272 | /** |
|---|
| | 273 | * Namespace: OpenLayers.Easing.Quad |
|---|
| | 274 | */ |
|---|
| | 275 | OpenLayers.Easing.Quad = { |
|---|
| | 276 | |
|---|
| | 277 | /** |
|---|
| | 278 | * Function: easeIn |
|---|
| | 279 | * |
|---|
| | 280 | * Parameters: |
|---|
| | 281 | * t - {Float} time |
|---|
| | 282 | * b - {Float} beginning position |
|---|
| | 283 | * c - {Float} total change |
|---|
| | 284 | * d - {Float} duration of the transition |
|---|
| | 285 | */ |
|---|
| | 286 | easeIn: function(t, b, c, d) { |
|---|
| | 287 | return c*(t/=d)*t + b; |
|---|
| | 288 | }, |
|---|
| | 289 | |
|---|
| | 290 | /** |
|---|
| | 291 | * Function: easeOut |
|---|
| | 292 | * |
|---|
| | 293 | * Parameters: |
|---|
| | 294 | * t - {Float} time |
|---|
| | 295 | * b - {Float} beginning position |
|---|
| | 296 | * c - {Float} total change |
|---|
| | 297 | * d - {Float} duration of the transition |
|---|
| | 298 | */ |
|---|
| | 299 | easeOut: function(t, b, c, d) { |
|---|
| | 300 | return -c *(t/=d)*(t-2) + b; |
|---|
| | 301 | }, |
|---|
| | 302 | |
|---|
| | 303 | /** |
|---|
| | 304 | * Function: easeInOut |
|---|
| | 305 | * |
|---|
| | 306 | * Parameters: |
|---|
| | 307 | * t - {Float} time |
|---|
| | 308 | * b - {Float} beginning position |
|---|
| | 309 | * c - {Float} total change |
|---|
| | 310 | * d - {Float} duration of the transition |
|---|
| | 311 | */ |
|---|
| | 312 | easeInOut: function(t, b, c, d) { |
|---|
| | 313 | if ((t/=d/2) < 1) return c/2*t*t + b; |
|---|
| | 314 | return -c/2 * ((--t)*(t-2) - 1) + b; |
|---|
| | 315 | }, |
|---|
| | 316 | |
|---|
| | 317 | CLASS_NAME: "OpenLayers.Easing.Quad" |
|---|
| | 318 | }; |
|---|