function expand(el)
{
var childObj = document.getElementById("child" + el)
var box = document.getElementById("box")
if (childObj.style.display == 'none')
{
childObj.style.display = 'block'
box.style......//按照上面的写法就可以了
}
else
{
childObj.style.display = 'none'
}
return
}
</SCRIPT>
<!DOCTYPE HTML><html>
<head>
<meta charset="UTF-8" />
<title>last.html</title>
<style type="text/css">
#end2{
color:#a00000
font-size:20px
font-weight:700
}
</style>
<script type="text/javascript">
Date.prototype.diff = function (date)
{
return (this.getTime () - date.getTime ()) / (24 * 60 * 60 * 1000)
}
onload = function ()
{
var now = new Date ('2015/02/19 00:00:00')
var date = new Date ()
var diff = now.diff (date)
document.getElementById ('end2').innerHTML = Math.floor (diff)
}
</script>
</head>
<body>
距过年
<span id="end2"></span> 天
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)