<script>window.addEventListener("resize",new Function("event","adjustLKMediaDiv(event);"),false)</script> <script>function juiceapp_bx(x, y, w, h) { this.l = x; this.r = x + w; this.t = y; this.b = y + h; }function cBB(o) { var b = new juiceapp_bx(0, 0, 0, 0); if (!o) return b; var x = 0, y = 0, p = o; try{ do { y+=p.offsetTop || 0; x+=p.offsetLeft || 0; p = p.offsetParent||p.parentNode; }while(p); }catch(e){} b.l = x; b.t = y; return b; }function adjustLKMediaDiv(event){var divs = document.getElementsByName('lk_juiceapp_mediaPopup_div');for(i=0;i<divs.length;i++){var d = divs[i];var embs = document.getElementsByTagName('embed');var iframes=document.getElementsByTagName('iframe');if (embs.length>0){for(var k=0;k<iframes.length;k++){embs[embs.length]=iframes[k];}}else{embs=iframes};var objects=document.getElementsByTagName('object');if (embs.length>0){for(var k=0;k<objects.length;k++){embs[embs.length]=objects[k];}}else{embs=objects}for(j=0;j<embs.length;j++){var emb = embs[j];if (emb.getAttribute('lk_media')!='yes'){continue;}if(emb.getAttribute('lk_mediaId') == d.id){var b = cBB(emb);d.style.left=(b.l+emb.clientWidth)+'px';d.style.top=(b.t+emb.clientHeight/2-30)+'px';break;}//end of if emb }//end of for embs }//end of for divs } </script>
<script type="text/javascript"> </script> <script type="text/javascript"> </script>
输入用户名及密码点击enter只接登录,功能代码如下:
页面
<asp:TextBox ID="txtUserName" runat="server" Width="150px" οnkeydοwn="return SubmitKeyClick(this,event)"></asp:TextBox>
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Width="150px" οnkeydοwn="return SubmitKeyClick(this,event)"></asp:TextBox>
<input id="btnLogin1" type="button" runat="server" value="登录" οnclick="return Checkuser()" />
js代码
function SubmitKeyClick(obj, evt) {
evt = (evt) ? evt : ((window.event) ? window.event : "")
keyCode = evt.keyCode ? evt.keyCode : (evt.which ? evt.which : evt.charCode);
//alert(evt);
//alert(keyCode);
if (keyCode == 13) {
document.getElementById("btnLogin1").focus();
}