欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

原生js實(shí)現(xiàn)可愛糖果數(shù)字時間特效

 更新時間:2016年12月30日 10:34:26   作者:roucheng  
本文主要介紹了原生js實(shí)現(xiàn)可愛糖果數(shù)字時間特效的實(shí)例代碼,附效果展示和代碼演示。具有一定的參考價值,下面跟著小編一起來看下吧

效果展示:http://demo.jb51.net/js/2016/js_hovertreecolortime/

源碼下載:http://xiazai.jb51.net/201612/yuanma/hovertreecolortime_jb51.rar

數(shù)字采用漂亮的糖果皮膚設(shè)計(jì)

效果圖:

代碼如下:

<!DOCTYPE html>
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>js多彩的數(shù)字時鐘_何問起</title><base target="_blank" />
 <style>a{color:blue;}</style>
</head>
<body>
 <div><h1>JS實(shí)現(xiàn)多彩的數(shù)字時鐘</h1></div>
 <div id="time"></div>
 <div><br /><br /><a >何問起</a> <a >說明</a> <a >特效</a></div>
 <script>
 function getTime(){
 var date = new Date();
 var hours =formatTime(date.getHours());
 var minutes = formatTime(date.getMinutes());
 var seconds = formatTime(date.getSeconds());
 var $time = document.getElementById('time');
 $time.innerHTML=hours +"<img src='images/hm.png' style='margin:0 10px;' width='12' height='40'/>"+ minutes+"<img style='margin:0 10px;' src='images/ms.png' width='12' height='40'/>"+ seconds;
 setTimeout("getTime()",500);
 }
 function formatTime(i){
 if(i<10&&i==1){
  i= "<img src='images/0.png' width='40' height='60'/>"+"<img src='images/1.png' width='20' height='60'/>";
 }else if(i<10&&i!=1){
  i= "<img src='images/0.png' width='40' height='60'/>" + "<img src='images/"+i+".png' width='40' height='60'/>";
 }else{
  var j= i.toString().charAt(0);
  var z =i.toString().charAt(1);
  if(j<10 && z<10&&j!=1&&z!=1){
  i = "<img src='images/"+j+".png' width='40' height='60'/>" + "<img src='images/"+z+".png' width='40' height='60'/>";
  }else if(j<10 && z<10&&j==1&&z!=1){
  i = "<img src='images/1.png' width='20' height='60'/>" + "<img src='images/"+z+".png' width='40' height='60'/>";
  }else if(j<10 && z<10&&z==1&&j!=1){
   i = "<img src='images/"+j+".png' width='40' height='60'/>"+"<img src='images/1.png' width='20' height='60'/>";
  }else if(j<10 && z<10&&(j==1&&z==1)){
  i="<img src='images/1.png' width='20' height='60'/>"+"<img src='images/1.png' width='20' height='60'/>";
  }
 }
 return i;
 }
 getTime();
 </script>
</body>
</html>

以上就是本文的全部內(nèi)容,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時也希望多多支持腳本之家!

相關(guān)文章

最新評論