JS控制DIV缩放问题

来源:百度知道 编辑:UC知道 时间:2024/05/02 01:23:11
<html>
<head>

<script language=javascript>
function menuShow(obj,maxh,obj2)
{
if(obj.style.pixelHeight<maxh)
{
obj.style.pixelHeight+=maxh/20;
obj.filters.alpha.opacity+=5;
obj2.style.backgroundImage = "url(images/2.jpg)";
if(obj.style.pixelHeight==maxh/10)
obj.style.display='block';
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout('menuShow(myObj,myMaxh,myObj2)','5');
}
}
function menuHide(obj,maxh,obj2)
{
if(obj.style.pixelHeight>0)
{
if(obj.style.pixelHeight==maxh/20)
obj.style.display='none';
obj.style.pixelHeight-=maxh/20;
obj.filters.alpha.opacity-=5;
obj2.style.backgroundImage = "url(images/1.jpg)";
myObj=obj;
myMaxh=maxh
myObj2=obj2;
setTimeout('menuHide(myObj,myMaxh,myObj2)','5');
}

<script language="JavaScript">
function expandit(objname,objPic){
if(objname.style.display == "none"){
objPic.src = "<%=request.getContextPath() %>/images/-.gif";
objname.style.display = "";
}
else{
objPic.src = "<%=request.getContextPath() %>/images/+.gif";
objname.style.display = "none";
}

}
</script>

<table width="128" border="0" cellpadding="0" cellspacing="0"
bgcolor="#FFFFFF">
<tr>
<td width="135" height="25" align="left" style="cursor: hand"
onclick="expandit(treeitem1,treepic1);">
<img src="<%=request.getContextPath() %>/images/+.gif" id="treepic1" width="11" height="11&qu