用鼠标点击就可展开收缩的网页特效JS代码

chen'mo
2008-08-30 / 0 评论 / 657 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于1970年01月01日,已超过19931天没有更新,若内容或图片失效,请留言反馈。

用鼠标点击就可展开收缩的网页特效JS代码 这个好像是我想要的,呵呵。。

<style type="text/css">
<!--
body,td,th {
 font-size: 12px;
}
span {cursor:pointer;color:blue;
}
-->
</style>
<script language="JavaScript">
function getElement(aID)
{
  return (document.getElementById) ? document.getElementById(aID)
                                   : document.all[aID];
}

var file_gx;
var f_timeID;
var f_move_step=4;//值越小越平滑,速度越慢
var f_move_speed=8; // 值越小越平滑,速度越慢
function ProductFile(){
 file_gx=Math.abs(parseInt(getElement("div_file").style.height)-150);
 if (f_timeID ==undefined){
   f_timeID = setTimeout(tween_weatherm_move,f_move_speed);
  }
 else {
   clearTimeout(f_timeID);
   f_timeID = setTimeout(tween_weatherm_move,f_move_speed);
 }
}


function tween_weatherm_move(){
 var wobj=getElement("div_file");
 var cx=parseInt(wobj.style.height);
  cx+=(file_gx-cx)/f_move_step;
  cx=parseInt(cx);
  wobj.style.height=cx+"px";
 if (Math.abs(cx-file_gx)<1){
  wobj.style.height=file_gx+"px";
  clearTimeout(f_timeID);
  f_timeID=undefined;
 }else{
  f_timeID = setTimeout(tween_weatherm_move,f_move_speed);
 }
}

</script>
<table width="500" border="0" cellpadding="3" cellspacing="1" bgcolor="#999999">
  <tr>
    <td height="25" align="right" bgcolor="#CCCCCC"><span onclick="ProductFile();">点击这里</span></td>
  </tr>
  <tr>
    <td  bgcolor="#FFFFFF" style="height:150px;" id="div_file">&nbsp;</td>
  </tr>
</table>

0
鼠标点击展开收缩的层网页特效
« 上一篇 08-30
3G金属翻盖 索尼爱立信Z770i详细评测
下一篇 » 08-31

评论 (0)

插入图片