Android手机上没有显示/坏掉的图像

时间:2016-02-12 08:17:48

标签: javascript angularjs image ionic-framework

我正在尝试用立方体制作一些简单的游戏,我制作了2个数组的图像,如show down,在我的代码中我将'kockice'显示为起始图像,然后在我的视图中点击按钮我将替换它们使用'zkockice',一个anim.gif之间有$ timeout(看起来像是洗牌),所有看起来都很好看,但是,当我离开运行android并在我的手机上模拟(android)它会显示破碎的图像,那么是否有一些资源问题或其他问题?

var kockice = new Array();
      kockice[0] = new Image();
      kockice[0].src = "/img/1.jpg";
      kockice[1] = new Image();
      kockice[1].src = "/img/2.jpg";
      kockice[2] = new Image();
      kockice[2].src = "/img/3.jpg";
      kockice[3] = new Image();
      kockice[3].src = "/img/4.jpg";
      kockice[4] = new Image();
      kockice[4].src = "/img/5.jpg";
      kockice[5] = new Image();
      kockice[5].src = "/img/6.jpg";

      var zkockice = new Array();
      zkockice[0] = new Image();
      zkockice[0].src = "/img/k1.jpg";
      zkockice[1] = new Image();
      zkockice[1].src = "/img/k2.jpg";
      zkockice[2] = new Image();
      zkockice[2].src = "/img/k3.jpg";
      zkockice[3] = new Image();
      zkockice[3].src = "/img/k4.jpg";
      zkockice[4] = new Image();
      zkockice[4].src = "/img/k5.jpg";
      zkockice[5] = new Image();
      zkockice[5].src = "/img/k6.jpg";

      var anim = "/img/anim.gif";

//here's the view, it shows starting images, but when on-click happens images get broken (in time when they have to change)
div class="row">
  <div class="col" id="k1"><img ng-src="img/1.jpg" ng-click="promjeni1()" id="sk1"></div>
  <div class="col" id="k2"><img ng-src="img/2.jpg" ng-click="promjeni2()" id="sk2"></div>
  <div class="col" id="k3"><img ng-src="img/3.jpg" ng-click="promjeni3()" id="sk3"></div>
  <div class="col" id="k4"><img ng-src="img/4.jpg" ng-click="promjeni4()" id="sk4"></div>
  <div class="col" id="k5"><img ng-src="img/5.jpg" ng-click="promjeni5()" id="sk5"></div> 
</div>

1 个答案:

答案 0 :(得分:0)

我也有这个问题。只需移除/

前面的.src即可