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

jQuery超酷平面式時(shí)鐘效果代碼分享

 更新時(shí)間:2020年03月30日 09:40:50   投稿:lijiao  
這篇文章主要介紹了jQuery制作的超酷平面式時(shí)鐘效果,把日期和時(shí)間通過橫向刻度條展現(xiàn),推薦給大家,有需要的小伙伴可以參考下

本文實(shí)例講述了jQuery超酷平面式時(shí)鐘效果代碼。分享給大家供大家參考,具體如下:

jQuery制作的超酷平面式時(shí)鐘效果,把日期和時(shí)間通過橫向刻度條展現(xiàn),經(jīng)測試效果非常酷,是一個(gè)很不錯(cuò)的學(xué)習(xí)實(shí)例。
這里我們還要提到之前實(shí)現(xiàn)的另一個(gè)特別新穎的時(shí)間顯示樣式:js實(shí)現(xiàn)溫度計(jì)時(shí)間樣式,兩者都完全突破了傳統(tǒng)的時(shí)鐘概念,感興趣的各位可不要錯(cuò)過了哈。

運(yùn)行效果圖:----------------------查看效果 下載源碼-----------------------

小提示:瀏覽器中如果不能正常運(yùn)行,可以嘗試切換瀏覽模式。
為大家分享的jQuery超酷平面式時(shí)鐘效果代碼如下

<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="JS代碼,時(shí)鐘,日期,刻度條,jQuery" />
<meta name="description" content="jQuery制作的超酷平面式時(shí)鐘效果,更多時(shí)鐘,日期,刻度條,jQuery請?jiān)L問腳本之家JS代碼頻道。" />
<title>jQuery制作的超酷平面式時(shí)鐘效果_腳本之家</title>

<style type="text/css">

body { background:#bae1ea url(back.jpg) 50% 0px no-repeat; color:#000; }

/* container for clock */
#wrap { position:relative; margin: 100px auto 0; width:700px; height:440px; background:url("slider clock(trans).png") no-repeat top left; border-style:solid; border-width:1px; overflow:hidden; }

/* style background and size of all sliding divs */
#wrap div { position:absolute; margin-left:-700px; width:1400px; height:40px; background:url("slider clock(trans).png") repeat-x; } 

/* specific position and background position for sliding divs */
#wrap #day { top:40px; background-position:0 -440px; }

#wrap #month { top:120px; background-position:0 -480px; }

#wrap #date { top:200px; background-position:0 -520px; }

#wrap #hour { top:280px; background-position:0 -560px; }

#wrap #min { top:320px; background-position:0 -600px; }

#wrap #sec { top:400px; background-position:0 -640px; }

#title { margin:20px auto; width:550px; text-align:center; }

#other { margin:10px auto; width:550px; text-align:center; }

</style>



<script type="text/javascript" src="jquery.js"> </script>

<script>

 $(document).ready(function(){

 function checktime(olddel){

  var now = new Date();

  var nowdel = now.getDay() + "|" + now.getMonth() + "|" + now.getDate() + "|" + now.getHours() + "|" + now.getMinutes() + "|" + now.getSeconds();

  if ( olddel != nowdel ) {

   var oldsplit = olddel.split("|");
   var nowsplit = nowdel.split("|");

   if ( oldsplit[5] != nowsplit[5] ) {

   clock_slide('#sec',nowsplit[5],11);
   if ( oldsplit[4] != nowsplit[4] ) {

    clock_slide('#min',nowsplit[4],11);
    if ( oldsplit[3] != nowsplit[3] ) {

    clock_slide('#hour',nowsplit[3],28);
    if ( oldsplit[2] != nowsplit[2] ) {

     clock_slide('#day',nowsplit[0],100);
     clock_slide('#date',(nowsplit[2]-1),22);

     if ( oldsplit[1] != nowsplit[1] ) {
     clock_slide('#month',nowsplit[1],57);

     };
    };
    };
   };
   };
  };

  function clock_slide(which,howmuch,multiple){
   $(which).stop().animate({marginLeft: ((howmuch*multiple)-700)+'px'}, 250, 'linear');
  };

  setTimeout(function(){checktime(nowdel);}, 250);


 };

  checktime("0|0|0|0|0|0");

 });

</script>



</head>

<body>



 <div id="wrap">

 <div id="day"> </div>

 <div id="month"> </div>
 <div id="date"> </div>
 <div id="hour"> </div>
 <div id="min"> </div>
 <div id="sec"> </div>

 </div> <!-- End "wrap" -->


<div style="text-align:center;clear:both">
<p>來源:<a href="http://www.dbjr.com.cn" target="_blank">vonholdt</a> 代碼整理:<a href="http://www.dbjr.com.cn" target="_blank">腳本之家</a> 感謝:<a href="http://www.dbjr.com.cn" target="_blank">liulisuo</a></p>
<p>轉(zhuǎn)載請注明出處,此代碼僅供學(xué)習(xí)交流,請勿用于商業(yè)用途。</p>
</div>
</body>
</html>

更多JavaScript時(shí)鐘特效點(diǎn)擊查看:JavaScript時(shí)鐘特效專題

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論