خرید بک لینک

Vote count: 0

First i am so sorry about my bad english . I waa ask how to make this script , i want to put the percents ? I mean every image to have their percent like um a image1 to have 5% to show up image 2 to have 10% to show up and like that?

<!DOCTYPE html>
<html>
<body>

<input class="randombutton" type="button" value="Randomize" onclick="randomImg1()"/>

<script type="text/javascript">
    function randomImg1() {


      myImages1 = new Array();
      myImages1[0] = "images/1.gif";
      myImages1[1] = "images/2.gif";
          myImages1[2] = "images/1.gif";
      myImages1[3] = "images/2.gif";
          myImages1[4] = "images/1.gif";
      myImages1[5] = "images/2.gif";
          myImages1[6] = "images/1.gif";
      myImages1[7] = "images/2.gif";
          myImages1[8] = "images/1.gif";
      myImages1[9] = "images/2.gif";
          myImages1[10] = "images/1.gif";
      myImages1[11] = "images/2.gif";
          myImages1[12] = "images/1.gif";
      myImages1[13] = "images/2.gif";
          myImages1[14] = "images/1.gif";
      myImages1[15] = "images/2.gif";
          myImages1[16] = "images/1.gif";
      myImages1[17] = "images/2.gif";
          myImages1[18] = "images/1.gif";
      myImages1[19] = "images/2.gif";

      var d = Math.floor( Math.random() * myImages1.length ); //incorporated other solution

      document.getElementById("image").ierHTML = "<img src='" + myImages1[d] + "' alt='image'></img>";
    }

</script>
<div id="image"></div>
</body>
</html>
asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 7 ارديبهشت 1395 ساعت: 0:46

صفحه بندی