日期:2014-05-17 浏览次数:20645 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
p{
width:110px;
height:30px;
padding:5px;
padding-top:20px;
padding-left:5px;
text-align: center;
}
p#quit{
background-color: #7FFF00;
}
p#search{
background-color: #00FFFF;
}
</style>
</head>
<body>
<div id="divSear" >
<p id="search" onmousemove="obtainedSearch()" onmouseout="leaveSearch()">搜索</p>
</div>
</body>
<script type="text/javascript">
function obtainedSearch(){
var srcSear = $("search");
srcSear.style.display="none";
var divSearCon = document.createElement("p");
divSearCon.id = "divSearCon";
var conSear = document.createElement("input");
conSear.type="text";
conSear.style.width="100%";
conSear.style.height = "21px";
var conText = document.createElement("button");
conText.value = "搜索" ;
conText.style.width = "50px";
conText.style.height = "20px";
divSearCon.appendChild(conSear);
divSearCon.appendChild(conText);
var div = $("divSear");
div.appendChild(divSearCon);
}
function leaveSearch(){
setTimeout("exeLeaveSearch()",5000);
}
function exeLeaveSearch(){
var div = $("divSear");
if( null != $("divSearCon") ){
$("divSearCon").style.display="none";
}
var relife = document.createElement("p");
relife.id = "search" ;
relife.innerHTML = "搜索" ;
div.appendChild(relife);
}
function $(id){
return document.getElementById(id);
}
</script>
</html>