87,921
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!--
#div1{position:relative;height:25px;width:60px;background-color:#FFD5AA;}
#div2{position:absolute;top:25px;left:0px;background-color:#B5FFB5;}
-->
</style>
<script type="text/javascript">
<!--
window.onload=function(){
$("div1").onmouseover=function(){
if ($("div2").style.width != "0px") return;
$("div2").style.display = "block";
expand($("div2"),"+",140,"block");
}
$("div1").onmouseout=function(){
if ($("div2").style.width != "140px") return;
expand($("div2"),"-",0,"none");
}
/*$("div2").onmouseover=function(){
if (stop){
clearTimeout(stop);
}
}*/
}
function expand(o,fuhao,wh,dis){
eval("var th = parseInt(o.style.height)"+fuhao+"5");
eval("var tw = parseInt(o.style.width)"+fuhao+"5");
o.style.height = th+"px";
o.style.width = tw+"px";
stop = setTimeout(function(){ expand(o,fuhao,wh,dis) },10);
if (th == wh || tw == wh){
clearTimeout(stop);
o.style.display = dis;
}
}
function $(oid){
return document.getElementById(oid);
}
//-->
</script>
</head>
<body>
<div id="div1">
<div id="div2" style="width:0px;height:0px;display:none;"></div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!--
#div1{position:relative;height:25px;width:60px;background-color:#FFD5AA;}
#div2{position:absolute;top:25px;left:0px;background-color:#B5FFB5;}
-->
</style>
<script type="text/javascript">
<!--
window.onload=function(){
var yt = null;
$("div1").onmouseover=function(){
if(yt) clearTimeout(yt);
if ($("div2").style.width != "0px") return;
$("div2").style.display = "block";
expand($("div2"),"+",140,"block");
}
$("div1").onmouseout=function(){
if ($("div2").style.width != "140px") return;
if(yt) clearTimeout(yt);
yt = setTimeout(function(){
expand($("div2"),"-",0,"none")
}, 50);
}
$("div2").onmouseover=function(){
clearTimeout(yt);
}
$("div2").onmouseout=function(){
if(yt) clearTimeout(yt);
yt = setTimeout(function(){
expand($("div2"),"-",0,"none")
}, 50);
}
}
function expand(o,fuhao,wh,dis){
eval("var th = parseInt(o.style.height)"+fuhao+"5");
eval("var tw = parseInt(o.style.width)"+fuhao+"5");
o.style.height = th+"px";
o.style.width = tw+"px";
stop = setTimeout(function(){ expand(o,fuhao,wh,dis) },10);
if (th == wh || tw == wh){
clearTimeout(stop);
o.style.display = dis;
}
}
function $(oid){
return document.getElementById(oid);
}
//-->
</script>
</head>
<body>
<div id="div1">
<div id="div2" style="width:0px;height:0px;display:none;"></div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!-- #div1 {
position: relative;
height: 25px;
width: 60px;
background-color: #FFD5AA;
} #div2 {
position: absolute;
top: 25px;
left: 0px;
background-color: #B5FFB5;
}
-->
</style>
<script type="text/javascript">
<!--
var stop = null;
window.onload = function(){
$("div1").onmouseover = mouseOver;
function mouseOver(e){
e = e || window.event;
if (stop) {
clearTimeout(stop);
}
$("div2").style.display = "block";
expand($("div2"), "+", 140, "block");
}
$("div1").onmouseout = $("div2").onmouseout = function(e){
e = e || window.event;
var elFrom = e.fromElement || e.target;
var elTo = e.toElement || e.relatedTarget;
if ((elFrom.id == "div1" && elTo.id == "div2") ||
(elFrom.id == "div2" && elTo.id == "div1")) {
return;
}
if (stop) {
clearTimeout(stop);
}
expand($("div2"), "-", 0, "none");
}
}
function expand(o, fuhao, wh, dis){
if (parseInt(o.style.height) == wh ||
parseInt(o.style.height) == wh) {
clearTimeout(stop);
o.style.display = dis;
stop = null;
return;
}
eval("var th = parseInt(o.style.height)" + fuhao + "5");
eval("var tw = parseInt(o.style.height)" + fuhao + "5");
o.style.height = th + "px";
o.style.width = tw + "px";
stop = setTimeout(function(){
expand(o, fuhao, wh, dis)
}, 10);
}
function $(oid){
return document.getElementById(oid);
} //-->
</script>
</head>
<body>
<div id="div1">
<div id="div2" style="width:0px;height:0px;display:none;">
</div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!--
#div1{position:relative;height:25px;width:60px;background-color:#FFD5AA;}
#div2{position:absolute;top:25px;left:0px;background-color:#B5FFB5;}
-->
</style>
<script type="text/javascript">
<!--
//=======ff的contains扩展
if(typeof(HTMLElement)!="undefined")HTMLElement.prototype.contains=function(o){
if(o==this)return true;
while(o=o.parentNode)if(o==this)return true;
return false;
}
window.onload=function(){
$("div1").onmouseover=function(){
if ($("div2").style.width != "0px") return;
$("div2").style.display = "block";
expand($("div2"),"+",140,"block");
}
$("div1").onmouseout=function(e){//---------------
e=e||event;//---------------
var toObj=e.toElement||e.relatedTarget;//---------------
if(this.contains(toObj))return;//---------------
if ($("div2").style.width != "140px") return;
expand($("div2"),"-",0,"none");
}
}
function expand(o,fuhao,wh,dis){
eval("var th = parseInt(o.style.height)"+fuhao+"5");
eval("var tw = parseInt(o.style.width)"+fuhao+"5");
o.style.height = th+"px";
o.style.width = tw+"px";
stop = setTimeout(function(){ expand(o,fuhao,wh,dis) },10);
if (th == wh || tw == wh){
clearTimeout(stop);
o.style.display = dis;
}
}
function $(oid){
return document.getElementById(oid);
}
//-->
</script>
</head>
<body>
<div id="div1">
<div id="div2" style="width:0px;height:0px;display:none;"></div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!-- #div1 {
position: relative;
height: 25px;
width: 60px;
background-color: #FFD5AA;
} #div2 {
position: absolute;
top: 25px;
left: 0px;
background-color: #B5FFB5;
}
-->
</style>
<script type="text/javascript">
<!--
window.onload = function(){
$("div1").onmouseover = mouseOver;
function mouseOver(e){
e = e || window.event;
if ($("div2").style.width != "0px") {
clearTimeout(stop);
}
$("div2").style.display = "block";
expand($("div2"), "+", 140, "block");
}
$("div1").onmouseout = $("div2").onmouseout = function(e){
e = e || window.event;
var elFrom = e.fromElement || e.target;
var elTo = e.toElement || e.relatedTarget;
if ((elFrom.id=="div1" && elTo.id == "div2")
|| (elFrom.id=="div2" && elTo.id == "div1")) {
return;
}
expand($("div2"), "-", 0, "none");
}
}
function expand(o, fuhao, wh, dis){
if (parseInt(o.style.height) == wh || parseInt(o.style.height) == wh) {
clearTimeout(stop);
o.style.display = dis;
return;
}
eval("var th = parseInt(o.style.height)" + fuhao + "5");
eval("var tw = parseInt(o.style.height)" + fuhao + "5");
o.style.height = th + "px";
o.style.width = tw + "px";
stop = setTimeout(function(){
expand(o, fuhao, wh, dis)
}, 10);
}
function $(oid){
return document.getElementById(oid);
}
//-->
</script>
</head>
<body>
<div id="div1">
<div id="div2" style="width:0px;height:0px;display:none;">
</div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!--
#div1{position:relative;height:25px;width:60px;background-color:#FFD5AA;}
#div2{position:absolute;top:25px;left:0px;background-color:#B5FFB5;}
-->
</style>
<script type="text/javascript">
<!--
window.onload = function(){
var t, div1 = $('div1'), div2=$('div2'), maxw = 140;
div2.t = null;
div1.onmouseover = function(){
if(t) clearTimeout(t);
status = div2.t;
if(div2.offsetWidth >= maxw) return;
div2.style.display = 'block';
clearInterval(div2.t);
div2.t = setInterval(function(){ expand(div2, 1, maxw);}, 10);
}
div1.onmouseout = function(){
if(div2.offsetWidth < maxw){
clearInterval(div2.t);
div2.t = setInterval(function(){ expand(div2, 0)}, 10);
}else{
t = setTimeout(function(){
div2.t = setInterval(function(){ expand(div2, 0)}, 10);
}, 1);
}
}
}
function expand(obj, s, w){
if(s){
if(obj.offsetWidth>=w){
clearTimeout(obj.t);
}else{
obj.style.width = obj.offsetWidth + 5 +'px';
obj.style.height = obj.offsetHeight + 5 +'px';
}
}else{
if(obj.offsetWidth<=0){
clearInterval(obj.t);
obj.style.display = 'none';
}else{
obj.style.width = obj.offsetWidth - 5 +'px';
obj.style.height = obj.offsetHeight - 5 +'px';
}
}
}
function $(oid){
return document.getElementById(oid);
}
//-->
</script>
</head>
<body>
<div id="div1">
<div id="div2" style="width:0px;height:0px;display:none;"></div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!-- #div1 {
position: relative;
height: 25px;
width: 60px;
background-color: #FFD5AA;
} #div2 {
position: absolute;
top: 25px;
left: 0px;
background-color: #B5FFB5;
}
-->
</style>
<script type="text/javascript">
<!--
window.onload = function(){
$("div1").onmouseover = function(e){
if ($("div2").style.width != "0px")
return;
$("div2").style.display = "block";
expand($("div2"), "+", 140, "block");
}
$("div1").onmouseout = $("div2").onmouseout = function(e){
e = e || window.event;
var elTo = e.toElement || e.relatedTarget;
if (elTo.id == "div1" || elTo.id == "div2") {
return;
}
if ($("div2").style.width != "140px")
return;
expand($("div2"), "-", 0, "none");
}
}
function expand(o, fuhao, wh, dis){
eval("var th = parseInt(o.style.height)" + fuhao + "5");
eval("var tw = parseInt(o.style.width)" + fuhao + "5");
o.style.height = th + "px";
o.style.width = tw + "px";
stop = setTimeout(function(){
expand(o, fuhao, wh, dis)
}, 10);
if (th == wh || tw == wh) {
clearTimeout(stop);
o.style.display = dis;
}
}
function $(oid){
return document.getElementById(oid);
}
//-->
</script>
</head>
<body>
<div id="div1">
<div id="div2" style="width:0px;height:0px;display:none;">
</div>
</div>
</body>
</html>