⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 状态栏提示停留时间.txt

📁 网页特效的代码,在美化网页时有很大的作用
💻 TXT
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>

<script>

var Temp;
var TimerId = null;
var TimerRunning = false;

Seconds = 0
Minutes = 0
Hours = 0

function showtime() 
{
if(Seconds >= 59) 
{
Seconds = 0
if(Minutes >= 59) 
{
Minutes = 0
if(Hours >= 23) 
{
Seconds = 0
Minutes = 0
Hours = 0
} 
else { 
++Hours 
}
} 
else { 
++Minutes 
}
} 
else { 
++Seconds 
}

if(Seconds != 1) { var ss="s" } else { var ss="" }
if(Minutes != 1) { var ms="s" } else { var ms="" }
if(Hours != 1) { var hs="s" } else { var hs="" }

Temp = '你在本页停留了 '+Hours+' 小时'+', '+Minutes+' 分'+', '+Seconds+' 秒'+''
window.status = Temp;
TimerId = setTimeout("showtime()", 1000);
TimerRunning = true;
}

var TimerId = null;
var TimerRunning = false;

function stopClock() {
if(TimerRunning) 
clearTimeout(TimerId);
TimerRunning = false;
}

function startClock() {
stopClock();
showtime();
}

function stat(txt) {
window.status = txt;
setTimeout("erase()", 2000);
}

function erase() {
window.status = "";
}

</SCRIPT>


</head>

<body onLoad="startClock()">
<p>第一步:把如下代码加入&lt;body&gt;区域中<br />
  &lt;script&gt;</p>
<p> var Temp;<br />
  var TimerId = null;<br />
  var TimerRunning = false;</p>
<p> Seconds = 0<br />
  Minutes = 0<br />
  Hours = 0</p>
<p> function showtime() <br />
  {<br />
  if(Seconds &gt;= 59) <br />
  {<br />
  Seconds = 0<br />
  if(Minutes &gt;= 59) <br />
  {<br />
  Minutes = 0<br />
  if(Hours &gt;= 23) <br />
  {<br />
  Seconds = 0<br />
  Minutes = 0<br />
  Hours = 0<br />
  } <br />
  else { <br />
  ++Hours <br />
  }<br />
  } <br />
  else { <br />
  ++Minutes <br />
  }<br />
  } <br />
  else { <br />
  ++Seconds <br />
  }</p>
<p> if(Seconds != 1) { var ss=&quot;s&quot; } else { var ss=&quot;&quot; }<br />
  if(Minutes != 1) { var ms=&quot;s&quot; } else { var ms=&quot;&quot; }<br />
  if(Hours != 1) { var hs=&quot;s&quot; } else { var hs=&quot;&quot; }</p>
<p> Temp = '你在本页停留了 '+Hours+' 小时'+', '+Minutes+' 分'+', '+Seconds+' 秒'+''<br />
  window.status = Temp;<br />
  TimerId = setTimeout(&quot;showtime()&quot;, 1000);<br />
  TimerRunning = true;<br />
  }<br />
  <br />
  var TimerId = null;<br />
  var TimerRunning = false;</p>
<p> function stopClock() {<br />
  if(TimerRunning) <br />
  clearTimeout(TimerId);<br />
  TimerRunning = false;<br />
  }</p>
<p> function startClock() {<br />
  stopClock();<br />
  showtime();<br />
  }</p>
<p> function stat(txt) {<br />
  window.status = txt;<br />
  setTimeout(&quot;erase()&quot;, 2000);<br />
  }</p>
<p> function erase() {<br />
  window.status = &quot;&quot;;<br />
  }</p>
<p>&lt;/SCRIPT&gt;</p>
<p>&nbsp;</p>
<p> <br />
  第二步:修改&lt;body***&gt;中的内容,将下面的代码加入原&lt;body***&gt;中<br />
  onLoad=&quot;startClock()&quot;<br />
</p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -