Skip to content
Snippets Groups Projects
Unverified Commit a958759c authored by Daniel Rudolf's avatar Daniel Rudolf
Browse files

Fix utils.slideUp() and utils.slideDown() in IE9

IE9 doesn't support sliding, but also doesn't support requestAnimationFrame(). Use setTimeout() with a delay of 16ms (1000ms / 60fps = 16.67ms) instead. This isn't optimal, but who cares about IE9... This is also true for IE8, even though we don't officially support it.
parent 86e6d344
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ utils.slideUp = function (element, finishCallback, startCallback)
if (!utils.canSlide()) {
if (startCallback) startCallback();
element.className += (element.className !== '') ? ' hidden' : 'hidden';
if (finishCallback) window.requestAnimationFrame(finishCallback);
if (finishCallback) window.setTimeout(finishCallback, 16);
return;
}
......@@ -83,7 +83,7 @@ utils.slideDown = function (element, finishCallback, startCallback)
if (!utils.canSlide()) {
if (startCallback) startCallback();
element.className = element.className.replace(/\bhidden\b */g, '');
if (finishCallback) window.requestAnimationFrame(finishCallback);
if (finishCallback) window.setTimeout(finishCallback, 16);
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment