From aa22706fe27c9d2767ed74d7f2856710af5eae23 Mon Sep 17 00:00:00 2001 From: Zhang Visper Date: Tue, 17 May 2016 15:53:19 +0800 Subject: [PATCH] Fix browser render bug --- package.json | 2 +- script/index.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b39c798..c25e5f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-notice", - "version": "0.2.0", + "version": "0.2.1", "description": "A notice plug-in for Vue", "main": "script/index.js", "repository": "https://github.com/coolzjy/vue-notice", diff --git a/script/index.js b/script/index.js index 5efe519..53d9908 100644 --- a/script/index.js +++ b/script/index.js @@ -91,10 +91,9 @@ document.body.appendChild(this.div) - // if set opacity sync, the transition will be ignored - setTimeout((function () { - applyStyle(this.div, showStyle) - }).bind(this), 0) + // make sure brower has render style above + window.getComputedStyle(this.div).opacity + applyStyle(this.div, showStyle) setTimeout((function () { applyStyle(this.div, hideStyle)