livereload不使用watch使用gulp

时间:2016-06-07 06:21:37

标签: javascript gulp livereload

不确定是什么问题,当我保存index.html时,它正确地构建了这些东西但它没有像我通常使用livereload那样刷新。下面是我的gulpfile.js

function changeBackground() {
  var x = 0;
  if (x % 2 === 0) {
    document.getElementById("sample").style.backgroundColor = "purple";
  }
  else {
    document.getElementById("sample").style.backgroundColor = "white";
  }
  x++;
}
var x = document.getElementById("sample");
x.onmouseover = changeBackground;

知道什么是错的吗?

0 个答案:

没有答案
相关问题