Skip to content

Commit

Permalink
Fix browser render bug
Browse files Browse the repository at this point in the history
  • Loading branch information
coolzjy committed May 17, 2016
1 parent 20bd779 commit aa22706
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 3 additions & 4 deletions script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aa22706

Please sign in to comment.