js 窗口自适应大小


function init(){      

              if( document.body.scrollWidth > (window.screen.availWidth-100) ){        

                      window.dialogWidth = (window.screen.availWidth-100).toString() + "px"    

               }

              else{        

                       window.dialogWidth = (document.body.scrollWidth +10).toString() + "px"    

                }           

              if( document.body.scrollHeight > (window.screen.availHeight-70) ){     

                      window.dialogHeight = (window.screen.availHeight-50).toString() + "px"    

               }else{        

                       window.dialogHeight = (document.body.scrollHeight +10).toString() + "px"    

               }    

                window.dialogLeft = ((window.screen.availWidth - document.body.clientWidth) / 2).toString() + "px" ;    

                window.dialogTop = ((window.screen.availHeight - document.body.clientHeight) / 2).toString() + "px"; \

         }


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM