jQuery超酷平面式时钟效果特效代码

版权:原创 更新时间:1年以上
[该文章底部包含文件资源,可根据自己情况,决定是否下载资源使用,时间>金钱,如有需要,立即查看资源]

以下是 jQuery超酷平面式时钟效果特效代码 的示例演示效果:

当前平台(PC电脑)
  • 平台:

部分效果截图:

jQuery超酷平面式时钟效果特效代码

HTML代码(index.html):

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery超酷平面式时钟效果</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" -->
</body>
</html>











附件:下载该文件资源,减少时间成本(增值服务)
留言
该资源可下载
File Source
.rar
864.79 KB
Html 时钟特效
最新结算
jquery虚拟键盘中文打字效果js代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
jquery虚拟键盘中文打字效果js代码
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
HTML5实现CSS滤镜图片切换特效代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
jQuery头像裁剪插件cropbox js代码
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
jQuery头像裁剪插件cropbox js代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
jQuery+css3实现信封效果
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
我们力求给您提供有用的文章,再此基础上,会附加营收资源,不做任何广告,让平台可以更好发展 若您发现您的权利被侵害,或使用了您的版权,请发邮件联系 sunlifel@foxmail.com ggbig觉得 : 不提供源码的文章不是好文章
合作伙伴
联系我们
  • QQ:21499807
  • 邮箱:sunlifel@foxmail.com
  • QQ扫一扫加QQ
    QQ扫一扫
Copyright 2023-2024 ggbig.com·皖ICP备2023004211号-1
打赏文章