diff --git a/src/js/controller/popover.js b/src/js/controller/popover.js index 28d635a..f756a69 100644 --- a/src/js/controller/popover.js +++ b/src/js/controller/popover.js @@ -33,6 +33,7 @@ define(function(require) { var width = elm[0].offsetWidth; var height = elm[0].offsetHeight; + popover[0].style.transition = 'opacity 0.4s linear'; popover[0].style.top = (top + height / 2 - popover[0].offsetHeight / 2) + 'px'; popover[0].style.left = (left + width) + 'px'; popover[0].style.opacity = '1'; @@ -40,7 +41,10 @@ define(function(require) { }); elm.on('mouseout', function() { + popover[0].style.transition = 'opacity 0.4s linear, top 0.4s step-end, left 0.4s step-end'; popover[0].style.opacity = '0'; + popover[0].style.top = '-9999px'; + popover[0].style.left = '-9999px'; }); }; }); diff --git a/src/sass/components/_popover.scss b/src/sass/components/_popover.scss index eb53e51..30ca392 100644 --- a/src/sass/components/_popover.scss +++ b/src/sass/components/_popover.scss @@ -19,7 +19,6 @@ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); white-space: normal; opacity: 0; - transition: opacity 0.4s; &.top { margin-top: -10px;