swftm这个函数是用来透明flash的

解决方案 »

  1.   

    我的那一段代码的原意是:
    先用ID号为sernemu的层展现出部分flash内容
    当鼠标动作时,展开和收缩ID号为sernemu的层来完全和部分展示出flash内容
      

  2.   

    <div id="sernemu" name="sernemu" onmouseover="mover();" onmouseout="mout();">
    你设置div的高度了吗?自己执行一下这个代码看输出什么
    alert(parseFloat(document.getElementById("sernemu").style.height));
      

  3.   

    alert(parseFloat(document.getElementById("sernemu").style.height)); 运行后出现的结果是"NaN"我在CSS样式中有定义sernemu的高度
    #sernemu { 
    width:528px; 
    height:189px; 
    overflow: hidden; 

      

  4.   

    错误的原因:
    ss.height得到空字符串
    parseFloat为NaN
    加“px”之后为NaNpx,所以赋给style.height会有错误。
    分析:
    document.getElementById("sernemu").style 指div的inline的style
    你的div的height属性是在css中设置的,所以ss.height会得到""(空字符串)
    有两个解决方案:
    1.将currentStyle(FF中为computedStyle)中的height赋给ss.height
    ss.height = document.getElementById("sernemu").currentStyle.height;
    2.如果你是要取实际高度,可以考虑使用offsetHeight
      

  5.   

    但是我这一块要动态的改变sernemu层的高度值怎么把值传回给sernemu的样式如果值不能回传应用的话,sernemu层展开收缩的效果就不能实现了
      

  6.   

    不需要回传
    直接设置给ss.height就可以了
    inline属性会覆盖css中的属性
    试试看:-)