maxheight的返回值是  xxpx, 不要在第一句结尾+"px"了.
function () 
{  var maxheight=$("#reg_middle").css("height");//假如高是100 则返回100px; 
  $("#pro_man_menu").css("height",maxheight); 
  $("#pro_man_action").css("height",maxheight); 
} 如果希望获取其高度 请用jquery中的height()宽度用width()方法.

解决方案 »

  1.   

    请问如果我用height(),如果我要减去30px作为maxheight。请问怎么做
      

  2.   

    var tempStr=$("#reg_middle").css("height"));
    var maxheight=parseInt(tempStr.substring(0,tempStr.length-2))+70)+"px";
    你可以把转化为INT值之后再来计算嘛...
      

  3.   

    Jquery的height()方法可以获得高度值。height():取得第一个匹配元素当前计算的高度值(px),返回值是Integer.这样写:
    function () 
    {  
      var maxheight = $("#reg_middle").height() - 70 + "px"; 
      $("#pro_man_menu").css("height", maxheight); 
      $("#pro_man_action").css("height", maxheight);