From e9239724468ab61205bab0a5a9e74453ed43787d Mon Sep 17 00:00:00 2001 From: Mohammad Younes Date: Sun, 15 Dec 2013 14:31:05 +0300 Subject: [PATCH] Fix issue #409 Force IE to repaint element to start the animation. More details here: https://github.com/Semantic-Org/Semantic-UI/issues/409 --- src/modules/transition.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/modules/transition.js b/src/modules/transition.js index 4129836fa..d5d03aeb3 100755 --- a/src/modules/transition.js +++ b/src/modules/transition.js @@ -165,9 +165,17 @@ $.fn.transition = function() { $.proxy(settings.complete, this)(); }, - repaint: function(fakeAssignment) { + repaint: function(removeThenAdd) { module.verbose('Forcing repaint event'); - fakeAssignment = element.offsetWidth; + var fakeAssignment = element.offsetWidth; + if (removeThenAdd) { + var parent = $module.parent(); + var next = $module.next(); + if (next.length == 0) + $module.detach().appendTo(parent); + else + $module.detach().before(next); + } }, has: { @@ -426,7 +434,7 @@ $.fn.transition = function() { .addClass(className.transition) .addClass(className.visible) ; - module.repaint(); + module.repaint(true/*or better: true only if its IE*/); }, start: function() {