申明:本站所有资源来源于网络,如有侵权,请联系我们删除。QQ:876703499 微信:yxkj0856 谢谢!

本站已运行天数代码分享

 二维码 480
发表时间:2018-09-08 20:57作者:admin来源:网络

代码1:

  1. 本站已安全运行:

  2. <span id="momk"></span>

  3. <script language=javascript>

  4. function show_date_time(){

  5. window.setTimeout("show_date_time()", 1000);

  6. BirthDay=new Date("05-06-2016 12:12:24");//建站日期

  7. today=new Date();

  8. timeold=(today.getTime()-BirthDay.getTime());

  9. sectimeold=timeold/1000

  10. secondsold=Math.floor(sectimeold);

  11. msPerDay=24*60*60*1000

  12. e_daysold=timeold/msPerDay

  13. daysold=Math.floor(e_daysold);

  14. e_hrsold=(daysold-e_daysold)*-24;

  15. hrsold=Math.floor(e_hrsold);

  16. e_minsold=(hrsold-e_hrsold)*-60;

  17. minsold=Math.floor((hrsold-e_hrsold)*-60);

  18. seconds=Math.floor((minsold-e_minsold)*-60);

  19. momk.innerHTML=daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒" ;

  20. }

  21. show_date_time();

  22. </script>

  23. <style>

  24. #momk{animation:change 10s infinite;font-weight:800; }

  25. @keyframes change{0%{color:#5cb85c;}25%{color:#556bd8;}50%{color:#e40707;}75%{color:#66e616;}100% {color:#67bd31;}}

  26. </style>

代码2:

  1. <span id="momk"></span><span id="momk" style="color: #ff0000;"></span>

  2. <script type="text/javascript">

  3. function NewDate(str) {

  4. str = str.split('-');

  5. var date = new Date();

  6. date.setUTCFullYear(str[0], str[1] - 1, str[2]);

  7. date.setUTCHours(0, 0, 0, 0);

  8. return date;

  9. }

  10. function momxc() {

  11. var birthDay =NewDate("2016-5-6");

  12. var today=new Date();

  13. var timeold=today.getTime()-birthDay.getTime();

  14. var sectimeold=timeold/1000

  15. var secondsold=Math.floor(sectimeold);

  16. var msPerDay=24*60*60*1000; var e_daysold=timeold/msPerDay;

  17. var daysold=Math.floor(e_daysold);

  18. var e_hrsold=(daysold-e_daysold)*-24;

  19. var hrsold=Math.floor(e_hrsold);

  20. var e_minsold=(hrsold-e_hrsold)*-60;

  21. var minsold=Math.floor((hrsold-e_hrsold)*-60); var seconds=Math.floor((minsold-e_minsold)*-60).toString();

  22. document.getElementById("momk").innerHTML = "本站已安全运行"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒";

  23. setTimeout(momxc, 1000);

  24. }momxc();

  25. </script>  <style>

  26. #momk{animation:change 10s infinite;font-weight:800; }

  27. @keyframes change{0%{color:#5cb85c;}25%{color:#556bd8;}50%{color:#e40707;}75%{color:#66e616;}100% {color:#67bd31;}}

  28. </style>



本站访问次数:AmazingCounters.com


Copyrigt © 2010-2018 电脑技术吧 Powered by Discuz!  X3.3 Theme by 永哥

yxzz.gif