第一种: 

jqGrid随窗口大小变化自适应宽度

$(function(){
            $(window).resize(function(){   
         $("#listId").setGridWidth($(window).width());
        });
       }); 

 

 

 

第二种:

window.onresize = function  _doResize() { 
 var ss = pageSize(); 
 $("#listId").jqGrid('setGridWidth', ss.WinW-10).jqGrid('setGridHeight', ss.WinH-200);
   }
   
 function pageSize() { 
   var winW, winH; 
  if(window.innerHeight) {// all except IE 
   winW = window.innerWidth; 
   winH = window.innerHeight; 
  } else if (document.documentElement && document.documentElement.clientHeight) {// IE 6 Strict Mode
   winW = document.documentElement.clientWidth; 
   winH = document.documentElement.clientHeight; 
  } else if (document.body) { // other 
   winW = document.body.clientWidth; 
   winH = document.body.clientHeight; 
  }  // for small pages with total size less then the viewport 
  return {WinW:winW, WinH:winH}; 
} 

 

相关文章:

  • 2022-12-23
  • 2021-04-17
  • 2021-12-29
  • 2022-03-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-04
  • 2021-10-14
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
相关资源
相似解决方案