<div class="codetitle"> <span><a style="CURSOR: pointer" data="94141" class="copybut" id="copybut94141" onclick="doCopy('code94141')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code94141"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><head> <br><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <br><title>无标题文档</title> <br><script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script> <br><script type="text/javascript"> <br>$(function() { <br>// JQuery代码 <br><br>var oldhh; <br>var oldmin; <br>var oldss; <br><br>$(document).ready(function() { <br>fillDate(); <br>}); <br>function fillDate(){ <br>var date = new Date(); <br>var yy = date.getFullYear(); <br>var mm = date.getMonth() 1; //截取月, <br>var dd = date.getDate(); //截取日, <br>var cal = yy "." mm "." dd; <br>var hh = date.getHours(); //截取小时, <br>var min = date.getMinutes(); //截取分钟, <br><br>var ss = date.getTime() % 60000; <br>ss = (ss - (ss % 1000)) / 1000; //然后,将得到的毫秒数再处理成秒 <br>//(hh ":" min ":" ss); <br>oldhh = hh; <br>oldmin = min; <br>oldss = ss; <br>//alert(oldmin ":" oldss); <br>} <br>window.setInterval(test,1000); <br>function test(){ <br>var date = new Date(); <br>var hh = date.getHours(); //截取小时,即8 <br>var min = date.getMinutes(); //截取分钟,即34 <br>var ss = date.getTime() % 60000; <br>ss = (ss - (ss % 1000)) / 1000; //然后,将得到的毫秒数再处理成秒 <br>var betweenhh; <br>var betweenmin; <br>var betweenss; <br><br>if(ss<oldss){ <br>betweenss = ss 60-oldss; <br>betweenhh = hh-oldhh; <br>betweenmin = (min betweenhh*60)-1 - oldmin; <br><br><br>//alert("距离上次刷新" betweenmin "分" betweenss "秒"); <br>}else{ <br>betweenss = ss-oldss; <br>betweenhh = hh-oldhh; <br>betweenmin = (min betweenhh*60) - oldmin; <br>//$("#message").html("距离上次刷新" betweenmin "分" betweenss "秒"); <br>//alert("距离上次刷新" betweenmin "分" betweenss "秒"); <br>} <br>if(betweenmin<10){ <br>if(betweenss<10){ <br>$("#message").html("距离上次刷新0" betweenmin "分0" betweenss "秒"); <br>}else{ <br>$("#message").html("距离上次刷新0" betweenmin "分" betweenss "秒"); <br>} <br><br>}else{ <br>if(betweenss<10){ <br>$("#message").html("距离上次刷新" betweenmin "分0" betweenss "秒"); <br>}else{ <br>$("#message").html("距离上次刷新" betweenmin "分" betweenss "秒"); <br>} <br>} <br>} <br>}); <br>function ByStateflag() <br>{ <br>alert("hah"); <br>var value = document.getElementById("stateflag").value; <br>alert(value); <br>} <br></script> <br></head> <br><body> <br><div id="message"> <br><br></div> <br><select id="stateflag" name="stateflag" onchange="ByStateflag()"> <br><option selected value="">交易状态</option> <br><option value="0">进行中</option> <br><option value="1">终止交易</option> <br><option value="3">买家已锁货</option> <br><option value="4">买家办款</option> <br><option value="5">交易完成</option> <br></select> <br><br></body> <br></html> <br> </div>