限时优惠活动
亲爱的苦力吧用户,我们为了回馈新老用户一直以来的鼎力支持,即日起(2025-02-06至2025-03-06)凡是购买苦力吧VIP/充值K币的新老用户,都直接可获得买一送一的优惠馈赠。例如:购买一个月的VIP会员可直接获得两个月的VIP会员;充值100K币可直接获得200K币,以此类推!有任何疑问可联系在线客服,感谢各位用户对苦力吧素材的信任与厚爱,我们将一如既往的给大家上新更多优质的素材源码,祝大家开工大吉、工作顺利、心想事成。

jquery动画翻转网页时钟插件

所属分类: 网页特效-日期时间    2023-09-26 11:57:28

jquery动画翻转网页时钟插件 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

jquery动画翻转网页时钟插件(共6个文件)

    • script.js
    • index.html
    • style.css

使用方法

  • code
  • source
  1. var myhour, myminute, mysecond;
  2. function flipNumber(el, newnumber) {
  3. var thistop = el.find(".top").clone();
  4. var thisbottom = el.find(".bottom").clone();
  5. thistop.addClass("new");
  6. thisbottom.addClass("new");
  7. thisbottom.find(".text").text(newnumber);
  8. el.find(".top").after(thistop);
  9. el.find(".top.new").append(thisbottom);
  10. el.addClass("flipping");
  11. el.find(".top:not(.new)").find(".text").text(newnumber);
  12. setTimeout(function () {
  13. el.find(".bottom:not(.new)").find(".text").text(newnumber);
  14. }, 500);
  15. }
  16. function setTime() {
  17. $(".flipper").removeClass("flipping");
  18. $(".flipper .new").remove();
  19. var date = new Date();
  20. var seconds = date.getSeconds().toString();
  21. if (seconds.length == 1) {
  22. seconds = "0" + seconds;
  23. }
  24. var minutes = date.getMinutes().toString();
  25. if (minutes.length == 1) {
  26. minutes = "0" + minutes;
  27. }
  28. var hour = date.getHours();
  29. if (hour > 12) {
  30. hour = hour - 12;
  31. }
  32. if (hour == 0) {
  33. hour = 12;
  34. }
  35. hour = hour.toString();
  36. if (hour.length == 1) {
  37. hour = "0" + hour;
  38. }
  39. if ($(myhour[0]).text() !== hour) {
  40. flipNumber($(myhour[0]).closest(".flipper"), hour);
  41. }
  42. if ($(myminute[0]).text() !== minutes) {
  43. flipNumber($(myminute[0]).closest(".flipper"), minutes);
  44. }
  45. if ($(mysecond[0]).text() !== seconds) {
  46. flipNumber($(mysecond[0]).closest(".flipper"), seconds);
  47. }
  48. setTimeout(function () {
  49. setTime();
  50. }, 500);
  51. }
  52. $(function () {
  53. myhour = $(".clock .flipper:nth-child(1) div:not(.new) .text");
  54. myminute = $(".clock .flipper:nth-child(2) div:not(.new) .text");
  55. mysecond = $(".clock .flipper:nth-child(3) div:not(.new) .text");
  56. setTime();
  57. });
var myhour, myminute, mysecond;

function flipNumber(el, newnumber) {
  var thistop = el.find(".top").clone();
  var thisbottom = el.find(".bottom").clone();
  thistop.addClass("new");
  thisbottom.addClass("new");
  thisbottom.find(".text").text(newnumber);
  el.find(".top").after(thistop);
  el.find(".top.new").append(thisbottom);
  el.addClass("flipping");
  el.find(".top:not(.new)").find(".text").text(newnumber);
  setTimeout(function () {
    el.find(".bottom:not(.new)").find(".text").text(newnumber);
  }, 500);
}
function setTime() {
  $(".flipper").removeClass("flipping");
  $(".flipper .new").remove();
  var date = new Date();
  var seconds = date.getSeconds().toString();
  if (seconds.length == 1) {
    seconds = "0" + seconds;
  }
  var minutes = date.getMinutes().toString();
  if (minutes.length == 1) {
    minutes = "0" + minutes;
  }
  var hour = date.getHours();
  if (hour > 12) {
    hour = hour - 12;
  }
  if (hour == 0) {
    hour = 12;
  }
  hour = hour.toString();
  if (hour.length == 1) {
    hour = "0" + hour;
  }
  if ($(myhour[0]).text() !== hour) {
    flipNumber($(myhour[0]).closest(".flipper"), hour);
  }
  if ($(myminute[0]).text() !== minutes) {
    flipNumber($(myminute[0]).closest(".flipper"), minutes);
  }
  if ($(mysecond[0]).text() !== seconds) {
    flipNumber($(mysecond[0]).closest(".flipper"), seconds);
  }
  setTimeout(function () {
    setTime();
  }, 500);
}

$(function () {
  myhour = $(".clock .flipper:nth-child(1) div:not(.new) .text");
  myminute = $(".clock .flipper:nth-child(2) div:not(.new) .text");
  mysecond = $(".clock .flipper:nth-child(3) div:not(.new) .text");
  setTime();
});

站长提示:
1. 苦力吧素材官方QQ群:950875342
2. 平台上所有素材资源,需注册登录会员方能正常下载。
3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 日期时间

jquery响应式日历方块热图插件

CalendarHeatmap.js是一个日历热图插件,可生成一个动态交互式、可自定义的日历热图,用于表示时间序列数据。鼠标悬停在小方格上,可显示当前日期时间。
  日期时间
 3316  0

jquery响应式模拟时钟动画特效

一款轻量级时钟模拟动画,自适应布局设计,极简风格!
  日期时间
 5391  0

jquery可自定义的倒计时计时器插件

一款基于bootstrap框架的定时器插件,您可以设置计时器递增或递减计数,可自定义设置开始和结束时间。
  日期时间
 5147  0

jquery简易的文本字符时钟插件

wordclock.js是一个轻量级简易的文字时钟插件,它可使用纯HTML、CSS和JavaScript在网页上呈现文本字符时钟。
  日期时间
 4322  0

评论数(0) 回复有机会获得K币 用户协议

^_^ 还没有人评论,快来抢个沙发!
😀
  • 😀
  • 😊
  • 😂
  • 😍
  • 😑
  • 😷
  • 😵
  • 😛
  • 😣
  • 😱
  • 😋
  • 😎
  • 😵
  • 😕
  • 😶
  • 😚
  • 😜
  • 😭
发表评论