窗口的自适应处理
YC窗口自适应处理
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 6 <link rel="shortcut icon" href="image/yc_48X48.ico" type="image/x-icon"></link> 7 <title>XXXXXXXXXXX</title> 8 <meta http-equiv="pragma" content="no-cache" /> 9 10 <link rel="stylesheet" type="text/css" href="css/login.css"/> <!-- 登录页面css --> 11 12 <script type="text/javascript" src="../common/thirdparty/jquery/jquery-1.6.min.js"></script><!-- jquery js类库 --> 13 <script type="text/javascript" src="" id="i18nEasyui"></script> 14 <script type="text/javascript" src="../i18n/i18n.js"></script> 15 <script type="text/javascript" src="../common/js/common.js"></script> 16 <script type="text/javascript" src="js/cookie.js"></script> <!-- 登录页面js --> 17 <script type="text/javascript" src="js/login.js"></script> <!-- 登录页面js --> 18 <script type="text/javascript"> 19 20 $(function () { 21 var cval = GetCookie ("name"); 22 if(cval!=null){ 23 document.getElementById("userid").value=cval; 24 } 25 var width=window.screen.width; 26 var height=window.screen.height; 27 var top=window.screenTop; 28 document.getElementById("dlmain").style.width=(width*0.8)+'px'; 29 document.getElementById("dlmain").style.left=(width*0.1)+"px"; 30 document.getElementById("dlmain").style.height=height+'px'; 31 document.getElementById("imgs").style.width=width+'px'; 32 document.getElementById("imgs").style.height=(height-top)+'px'; 33 document.getElementById("loignback").style.width=(width*0.622)+'px'; 34 document.getElementById("loignback").style.height=(width*0.362)+'px'; 35 document.getElementById("ycsy").style.width=(width*0.35)+'px'; 36 document.getElementById("ycsy").style.height=(width*0.025)+'px'; 37 document.getElementById("ycsy").style.top=(width*0.124)+"px"; 38 document.getElementById("SuperEarth").style.top=(width*0.205)+"px"; 39 document.getElementById("logininfo").style.top=(width*0.22)+"px"; 40 if(width!=800){ 41 document.getElementById("SuperEarth").style.fontSize='14px'; 42 document.getElementById("userid").style.fontSize='14px'; 43 document.getElementById("pass").style.fontSize='14px'; 44 }else{ 45 document.getElementById("SuperEarth").style.fontSize='11px'; 46 document.getElementById("userid").style.fontSize='11px'; 47 document.getElementById("pass").style.fontSize='11px'; 48 } 49 document.getElementById("logininfo").style.width=(width*0.256)+'px'; 50 document.getElementById("logininfo").style.height=(height*0.13)+'px'; 51 document.getElementById("centerdiv").style.width=(width*0.585)+'px'; 52 document.getElementById("centerdiv").style.height=(width*0.073)+'px'; 53 54 document.getElementById("userid").style.height=(width*0.022)+"px"; 55 document.getElementById("pass").style.height=(width*0.022)+"px"; 56 57 document.getElementById("userid").style.lineHeight=(width*0.022)+"px"; 58 document.getElementById("pass").style.lineHeight=(width*0.022)+"px"; 59 60 document.getElementById("userid").style.width=(width*0.154)+"px"; 61 document.getElementById("pass").style.width=(width*0.154)+"px"; 62 63 document.getElementById("imgId").style.width=(width*0.076)+"px"; 64 document.getElementById("resetBtn").style.marginRight=(width*0.065)+"px"; 65 }); 66 67 </script> 68 </head> 69 <body style="background:#EAEAEA;overflow: hidden;" > 70 <div id='imgs' style="border:0;margin:0px auto; "> 71 <img src="image/bj.png" width="100%" height="100%"/> 72 <div id="dlmain" style="margin:0px auto; border:0;position: absolute; top: 0px;"> 73 <div id="centerdiv" style="margin: 0px auto;"> 74 <div style="height: 30%"></div> 75 <div style="height: 70%;"><!-- <img src="image/logycsy.png" height="100%"/> --></div> 76 </div> 77 <div id="loignback" style="margin: 0px auto;"> 78 <img src="image/loginbackground3.png" width="100%"/> 79 80 <div id="ycsy" style="position:absolute;left:40%;"> 81 <img src="image/ycsy3.png" width="100%" /> 82 </div> 83 84 <div id="SuperEarth" style="position: absolute;left:58%"> 85 <a style="font-family:宋体;color:#a9a9a9;text-decoration:none" href="" id="resetBtn1" onclick="downfile(32)">SuperEarthClient下载 </a> 86 </div> 87 <!-- 登录信息输入区域 --> 88 <div class="logininfo" id="logininfo" style="position: absolute;left:53%"> 89 <table width="100%" cellspacing="10"> 90 <tr > 91 <td align="left" style="border:0px solid;" ><input type="text" name="userid" id="userid" style="color:#666666;" value='' class="inputStyple1" onfocus="getFocus(this)" onblur="loseFocus(this)"/></td> 92 </tr> 93 <tr> 94 <td align="left" style="border:0px solid" ><input type="password" name="pass" id="pass" style="color:#666666;" value='' class="inputStyple2" onfocus="getFocus(this)" onblur="loseFocus(this)"/></td> 95 </tr> 96 <tr> 97 98 <td align="right" style="margin-right: 2px;"> 99 <p> 100 <input id="saveCookie" type="checkbox" value="" /> 101 <span style="font-size:12px; color:blue;">记住用户名</span> 102 <a class="btn" href="#" id="resetBtn" onclick="login()"><img id="imgId" style="border:solid 0px #ddd;padding:0px;" src="image/login_button.png"></img></a></p> 103 </td> 104 </tr> 105 </table> 106 </div> 107 </div> 108 </div> 109 </div> 110 </body> 111 </html>
NW的首页窗口自适应处理
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 6 <title>XXXXXXXXXXXX</title> 7 <meta http-equiv="pragma" content="no-cache" /> 8 9 <link rel="stylesheet" type="text/css" href="css/login.css"/> 10 <link rel="stylesheet" type="text/css" href="../common/thirdparty/jquery/themes/default/easyui.css"/> 11 <link rel="stylesheet" type="text/css" href="../common/thirdparty/jquery/themes/icon.css"/> 12 <link rel="stylesheet" type="text/css" href="../common/css/queryStyle.css"/> 13 14 <script type="text/javascript" src="../common/thirdparty/jquery/jquery-1.6.min.js"></script><!-- jquery js类库 --> 15 <script type="text/javascript" src="../common/thirdparty/jquery/jquery-1.6.min.js"></script> 16 <script type="text/javascript" src="../common/thirdparty/jquery/jquery.easyui.min.js"></script> 17 <script type="text/javascript" src="../common/thirdparty/jquery/locale/easyui-lang-zh_CN.js"></script> 18 <script type="text/javascript" src="../common/js/validate_class.js"></script> 19 <script type="text/javascript" src="../common/js/common.js"></script> 20 <script type="text/javascript" src="../i18n/i18n.js"></script> 21 <script language="javascript" type="text/javascript"></script> 22 <script type="text/javascript" src="js/login.js"></script> 23 </head> 24 <body onresize="initPageSize()"> 25 <div id="dl_main"> 26 <div class="logoName"></div> 27 <!-- 登录信息输入区域 --> 28 <div class="logininfo"> 29 <table width="100%" > 30 <tr> 31 <td colspan="2" align="center"> 32 <a style="font-family:宋体;color:#000000;text-decoration:none" id="resetBtn1" onclick="downfile(32)">SuperEarthClient下载 </a> 33 </td> 34 </tr> 35 <tr> 36 <td colspan="2" class="loginTd"><input type="text" name="userid" id="userid" value='admin' style="width:96%;height: 90%;"/></td> 37 </tr> 38 <tr> 39 <td colspan="2" class="loginTd"><input type="password" name="pass" id="pass" value='111111' style="width:96%;height: 90%;"/></td> 40 </tr> 41 42 <tr> 43 <td class="loginTd"><input type="text" name="" id="loginCodeId" value='验证码' style="width:90%;height: 90%;" onfocus=" if(this.value == '验证码') this.value = ''" onblur="if(this.value == '') this.value = '验证码'"/></td> 44 <td> 45 <input type="text" disabled="disabled" readonly="readonly" class="code" id="checkCode" value="" style="width:40%;height: 90%;"/> 46 <a href="#" onclick="createCode()" style="font-family:宋体;color:#000000;">看不清</a> 47 </td> 48 </tr> 49 <tr> 50 <td colspan="2" align="center"> 51 <input type="image" class="btn" id="login" value="登录" onclick="login()" src="image/signIn.png"/> 52 <input type="image" class="btn" id="reset" value="重置" onclick="" src="image/reset.png"/> 53 </td> 54 </tr> 55 </table> 56 </div> 57 </div> 58 </body> 59 </html>
/** * * 文件描述: 登录页面js。 * * @author zhanggf * @version 1.0 创建时间: 2012-10-30 上午8:46:07 */ $(function() { $.ajaxSetup({ cache:false }); // initPageSize(); // changelanguage(); // 初始化页面中英文 // 防止在iframe里出现登录页面 if (window.parent != window) { window.parent.location.reload(true); } //验证码 createCode(); }); function initPageSize() { var height = document.documentElement.clientHeight; document.getElementById("dl_main").style.height = height; } /** * 功能描述:根据用户选择的语言,改变页面元素语言 */ function changelanguage() { var language = document.getElementById("language").value; if (language == "en") { $("#usernamelabel").html("username:"); $("#passwordlabel").html("password:"); $("#languagelabel").html("language:"); $("#forgetPassword").html("forgot password?"); document.getElementById("login").src = "image/LoginButtonEnglish.png"; } else { $("#usernamelabel").html("用 户:"); $("#passwordlabel").html("密 码:"); $("#languagelabel").html("语 言:"); $("#forgetPassword").html("忘记密码?"); document.getElementById("login").src = "image/LoginButtonChinese.png"; } } /** * 下载SuperEarthClient * @param num */ function downfile(num){ /*rootPath+"download/downloadFile.do?num=32"*/ if(num=='32'){ var url = getRootPath()+"superEarth/file/SuperEarth_V1.12.0.53.rar"; $("#resetBtn1").attr("href",url); // $("#resetBtn1").attr("href","../download/downloadFile.do?num=32"); }else if(num=='64'){ $("#resetBtn2").attr("href","../download/downloadFile.do?num=64"); } } /** * 功能描述:登录 */ function login() { $("#login").attr("disabled", "disabled");// 点击登录按钮时首先将按钮置为不可用,防止重复点击;如果登录失败,重新将按钮置为可用状态 var userid = $("#userid").val(); var pass = $("#pass").val(); var i18n = 'zh_CN'; //验证码验证 // var flag = false; // flag = validate (); // if(!flag){ // $("#login").removeAttr("disabled", "disabled"); // return; // } $.post("../login/login.do?", { logintype : 0,// 0为普通用户登录(外网用户登录),1为域用户登录(内网用户登录) userid : userid, pass : pass, i18n : i18n }, function(result) { if (result.success) { saveloginlog();// 记录登录日志 window.location = './southernpg.htm?userName=' + userid + '&i18n=' + i18n; } else { alert(result.msg); $("#login").removeAttr("disabled"); } }, 'json'); } /** * 功能描述:记录登录日志 */ function saveloginlog() { $.ajax({ url : "../login/saveloginlog.do?", success : function(result) { }, dataType : "json", async : false, error : function() { } }); } var $win; /** * 修改密码 */ function forgotPassword(){ $win=$('#findPassword').window({ title: '忘记密码', width: 350, height: 150, modal: true }); } /** * 忘记密码确认提交 */ function confirmSubmit(){ var url = rootPath+'jasframework/login/forgotPassword.do'; $('#forgotPassword').form('submit', { url: url, dataType:"json", onSubmit : function(){ return $(this).form('validate'); }, success: function(result){ var result = eval('(' + result + ')'); if (result.success){ $.messager.alert("提示", result.msg, "info",function(){ $win.window('close'); }); } else { $.messager.alert('错误',result.msg,result.error); } } }); } /**========================验证码开始=============**/ var code ; //在全局 定义验证码 function createCode(){ code = ""; var codeLength = 4;//验证码的长度 var checkCode = document.getElementById("checkCode"); checkCode.value = ""; var selectChar = new Array(1,2,3,4,5,6,7,8,9, 'a','b','c','d','e','f','g','h','j','k','l','m','n','p','q', 'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F', 'G','H','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z'); for(var i=0;i<codeLength;i++) { var charIndex = Math.floor(Math.random()*60); code +=selectChar[charIndex]; } if(code.length != codeLength){ createCode(); } checkCode.value = code; } function validate () { var inputCode = document.getElementById("loginCodeId").value.toUpperCase(); var codeToUp=code.toUpperCase(); if(inputCode.length <=0) { alert("请输入验证码!"); return false; } else if(inputCode != codeToUp ){ alert("验证码输入错误!"); createCode(); return false; } else { return true; } } /**======================验证码结束==================**/ /** * 关闭忘记密码页面 */ function closeWindow(){ $win.window('close'); }