╋艺 镇╋╋网站网络|程序语言|Flash╋┣◇网站建设&Web语言 → css expression的问题


  共有15573人关注过本帖树形打印复制链接

主题:css expression的问题

美女呀,离线,留言给我吧!
admin
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 司令 亲民勋章
等级:管理员 帖子:3027 积分:27515 威望:0 精华:7 注册:2003/12/30 16:34:32
css expression的问题  发帖心情 Post By:2012/3/5 11:55:08 [只看该作者]

请教下 我这个div怎么写的不正常显示啊?

<div id="Ibuttom" style="position: absolute; top: expression(parseInt(document.getElementById("Idata").style.height)-20+"px"); width: 100%; height: 20px; background-color: #7F7F7F;"></div>

 

完整的代码是

 

<div id="Idata" style="position: absolute; left: 240px; top: 100px; width: 512px; height: 480px; background-color: #000000;">
      <div id="Itop" align="center" style="position: absolute; width: 100%; height: 20px; background-color: #7F7F7F;"></div>
      <div id="Ibuttom" style="position: absolute; top: expression(parseInt(document.getElementById("Idata").style.height)-20)px; width: 100%; height: 20px; background-color: #7F7F7F;"></div>
      <div id="Icanvas" style="position: absolute; left: 32px; top: 32px; width: 416px; height: 416px; background-color: #000000;">

      </div>
    </div>



---------------------------------

Ibuttom这个div是在Idata里面的,你在里面取外面的高度当然取不到了

 

<div id="Idata" style="position: absolute; left: 240px; top: 100px; width: 512px; height: 480px; background-color: #000000;">
      <div id="Itop" align="center" style="position: absolute; width: 100%; height: 20px; background-color: #7F7F7F;"></div>
      <div id="Ibuttom" style="position: absolute;width: 100%; height: 20px; background-color: #7F7F7F;"></div>
      <div id="Icanvas" style="position: absolute; left: 32px; top: 32px; width: 416px; height: 416px; background-color: #000000;">

      </div>
    </div>

<script type="text/javascript">

document.getElementById("Ibuttom").style.top=(document.getElementById("Idata").clientHeight-20)+"px";

</script>



http://wenwen.soso.com/z/q151061779.htm


  
“艺镇”官方站:www.zyzsky.com QQ群:1221854  回到顶部