mirror of
https://github.com/picocms/pico-theme.git
synced 2025-01-17 12:28:12 +01:00
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.
This commit is contained in:
parent
86e6d344b0
commit
a958759cb1
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user