Browse Source

Add requestanimationframe to shape

pull/1129/head
jlukic 10 years ago
parent
commit
0267dee0d3
1 changed files with 15 additions and 7 deletions
  1. 22
      src/definitions/modules/shape.js

22
src/definitions/modules/shape.js

@ -24,6 +24,13 @@ $.fn.shape = function(parameters) {
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
requestAnimationFrame = window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(callback) { setTimeout(callback, 0); },
returnedValue
;
@ -114,18 +121,19 @@ $.fn.shape = function(parameters) {
$module
.addClass(className.animating)
;
module.repaint();
$module
.addClass(className.animating)
;
$activeSide
.addClass(className.hidden)
;
$sides
.css(propertyObject)
.one(module.get.transitionEvent(), callback)
;
module.set.duration(settings.duration);
requestAnimationFrame(function() {
$module
.addClass(className.animating)
;
$activeSide
.addClass(className.hidden)
;
});
}
else {
callback();

Loading…
Cancel
Save