Home>

First, js code:

<script type="text/javascript">
$(function () {
  randomcloudlabel ();
});
function randomcloudlabel () {
  var obj=$("#cloudlabel a");
  function rand (num) {
    return parseint (math.random () * num + 1);
  }
  function randomcolor () {
    var str=math.ceil (math.random () * 16777215) .tostring (16);
    if (str.length<6) {
      str="0" + str;
    }
    return str;
  }
  for (len=obj.length, i=len;i--;) {
    obj [i] .style.left=rand (600) + "px";
    obj [i] .style.top=rand (400) + "px";
    obj [i] .classname="color" + rand (5);
    obj [i] .style.zindex=rand (5);
    obj [i] .style.fontsize=rand (50) + 12 + "px";
    obj [i] .style.color="#" + randomcolor ();
  }
}
</script>

Second, html code:

<div>
  <a href="#">Web Standard Learning</a><a href="#">css</a>a href="#">html5</a>
  <a href="#">canvas</a><a href="#">video</a>"#">jquery</a>
  <a href="#"&jquerymobile</a><a href="#">flash</a>"#">chrome</a>
  <a href="#">opera</a><a href="#">ie9</a>href="#">andriod</a>
  <a href="#">apple</a><a href="#">google</a><a href="#">jobs</a>
</div>
  • Previous Jquery implements the completion of the drop-down prompt function when entering the mailbox
  • Next AngularJS basic ng-href instruction usage