javascript键盘事件表单交互

键盘选择表单
  1.   <style type="text/css">
  2.   *{
  3.   margin:0px;padding:0px;font-size:12px;
  4.   }
  5.   input{
  6.       width:100px;height:20px;border:1px solid #ccc;
  7.     }
  8. TD { cursor: hand; }   
  9.   </style>
  10.   <script language="javascript" type="text/javascript">   
  11.     function document.onkeydown(){  
  12.      if(document.all('oTable')){
  13.          var rowsArray = document.all('oTable').rows;  
  14.          for(var i=0;i<rowsArray.length;i++){  
  15.               if(rowsArray[i].children[0].style.backgroundColor=='#dcdcdc'){  
  16.                  switch(window.event.keyCode){  
  17.                      case 38 :  
  18.                          if(i-1>=0){  
  19.                            rowsArray[i-1].children[0].style.backgroundColor = '#dcdcdc';   
  20.                            rowsArray[i].children[0].style.backgroundColor = '';  
  21.                          }  
  22.                          break;  
  23.                      case 40 :  
  24.                          if(i+1<=rowsArray.length-1){  
  25.                             rowsArray[i+1].children[0].style.backgroundColor = '#dcdcdc';    
  26.                             rowsArray[i].children[0].style.backgroundColor = '';  
  27.                          }  
  28.                          break;                           
  29.                      case 13 :  
  30.                  var str = rowsArray[i].childNodes[0].innerHTML;
  31.                document.getElementById("username").value = str;
  32.                document.getElementById("tips").style.display='none';            
  33.                         break;   
  34.                  break;  
  35.               }  
  36.          }  
  37.          }
  38.       }  
  39.       function document.onclick(){  
  40.        if(document.all('oTable')){
  41.           if(window.event.srcElement.tagName!='TD'){ return; }  
  42.           var rowsArray = document.all('oTable').rows;  
  43.           for(var i=0;i<rowsArray.length;i++){  
  44.                if(rowsArray[i].cells[0]==window.event.srcElement){  
  45.                   rowsArray[i].cells[0].style.backgroundColor = '#dcdcdc';  
  46.                }else{  
  47.                   rowsArray[i].cells[0].style.backgroundColor = '';  
  48.                }  
  49.           }   
  50.         }         
  51.       }  
  52.   function doaaa(id)
  53.   {
  54.   var str = id.childNodes[0].innerHTML;
  55.   alert(str);
  56.     document.getElementById("username").value = str;
  57.     document.getElementById("tips").style.display='none';
  58.   return true;
  59.   }
  60. var aid = new Array("人民币","美刀","英镑","欧元","港币");
  61. function tips(id,str){
  62. var l=document.getElementById(id).offsetLeft+120;
  63. var t=document.getElementById(id).offsetTop;
  64. var htmlstring ="<table id=/"oTable/" width=/"100/">";
  65. for(var i=0;i<aid.length;i++){
  66. if(i==0){htmlstring = htmlstring+"<tr height=/"20/" οnclick=/"doaaa(this);/"><td style=/"background-color:#dcdcdc;/">0"+i+":"+aid[i]+"</td></tr>";}
  67. else{htmlstring = htmlstring+"<tr height=/"20/" οnclick=/"doaaa(this);/"><td>0"+i+":"+aid[i]+"</td></tr>";}
  68. }
  69. htmlstring = htmlstring+"</table>";
  70. var inheight = aid.length*22+"px";
  71. document.getElementById("tips").innerHTML=htmlstring;
  72. document.getElementById("tips").style.left=l+"px";
  73. document.getElementById("tips").style.top=t+"px";
  74. document.getElementById("tips").style.height=inheight;
  75. document.getElementById("tips").style.display="block";
  76. }
  77. function outtips(){
  78. for(var i=0;i<aid.length;i++){
  79.  if(document.getElementById("username").value=="0"+i) 
  80.   document.getElementById("username").value=aid[i];
  81. }
  82.     //if(document.getElementById("username").value==0+"") 
  83.   //  document.getElementById("tips").style.display='none';
  84. }
  85. </script>
  86. </head>
  87. <body>
  88.                     
  89. <div id="tips" style="position:absolute;border:1px solid #ccc;padding:0px 3px;color:#f00;display:none;height:200px;line-height:20px;background:#fcfcfc"></div>
  90. <br />
  91. 姓名:<input type="text" id="username" οnfοcus="tips('username','姓名长度最多16个字符')" οnblur="outtips()" />
  92. <br />
  93. 密码:<input type="password" id="password" οnfοcus="tips('password','密码长度必须在3-18位之间')" οnblur="outtips()" />
  94. </body>
  95. </html>

Msdn Menu

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>MSND menu</title>
  5. <meta name="Generator" content="EditPlus">
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  7. <meta name="Author" content="">
  8. <meta name="Keywords" content="">
  9. <meta name="Description" content="">
  10. <style>
  11. .LocaleManagementFlyoutPopup {
  12.  font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
  13.   border:1px solid #666666;
  14.   padding: 3px 3px 3px 3px;
  15.   text-align: left;
  16.   background-color: #FFFFFF;
  17.   z-index: 10;
  18.   opacity: .95;
  19.   filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2,OffY=2,Color='silver',Positive='true') alpha(opacity=95);
  20. }
  21. .LocaleManagementFlyoutPopup A, .LocaleManagementFlyoutPopup A:visited {
  22.   font-size: 10px;
  23.   color: #000000;
  24.   cursor: hand;
  25.   border: 1px solid #FFFFFF;
  26.   padding: 1px 3px 1px 3px;
  27.   height: 15px;
  28.   text-align: left;
  29.   text-decoration: none;
  30.   white-space: nowrap;
  31.   display: block;
  32. }
  33. .LocaleManagementFlyoutPopup A:hover {
  34.   background-color: #f0f7fd;
  35.   color: #000000;
  36.   cursor: hand;
  37.   border: 1px solid #addbef;
  38.   padding: 1px 3px 1px 3px;
  39.   height: 15px;
  40.   text-decoration: none;
  41.   white-space: nowrap;
  42.   display: block;
  43. }
  44. .LocaleManagementFlyoutPopupHr {
  45.  height: 1px;
  46.  background: #d0e0f0;
  47.  margin: 0px 11px 21px 11px;
  48. }
  49. .LocaleManagementFlyoutPopArrow {
  50.   margin: 4px 0px 0px 0px;
  51. }
  52. .LocaleManagementFlyoutStatic_msdn {
  53.  border: 1px solid #ffffff;
  54. }
  55. .LocaleManagementFlyoutStaticHover_msdn {
  56.  border: 1px solid #addbef;
  57. }
  58. .TFlyPopupAnimate {
  59.  position: absolute;
  60.  display: block;
  61.  border: 1px solid gray;
  62.  overflow: hidden;
  63.  visibility: hidden;
  64.  margin: 0;
  65.  padding: 0;
  66.  z-index: 1;
  67. }
  68. </style>
  69. <script>
  70. /*
  71. name 对象的 id 值
  72. offsetLeft 定位:左 - 偏移量
  73. offsetTop 定位:顶部 - 偏移量
  74. alignment 对齐方式{-1: left; 0: center; 1: right}
  75. anyIter 显示方式(<=0: 普通样式; >0: 缩放样式)
  76. anyTime 动画时间间隔
  77. staticHover 鼠标覆盖时的样式
  78. popupHover 显示内容鼠标覆盖时的样式
  79. popupLatency 显示内容延时
  80. hideLatency 隐藏内容延时
  81. onInit 初始化
  82. onPopup 显示内容时行为
  83. onHide 隐藏内容时行为
  84. */
  85. function TFly_Init(name, offsetLeft, offsetTop, alignment, anyIter, anyTime, staticHover, popupHover, popupLatency, hideLatency, onInit, onPopup, onHide) {
  86.  var TFly = document.getElementById(name);
  87.  TFly.DT = document.getElementById(name + "_Popup"); // 显示内容对象
  88.  TFly.F = document.getElementById(name + "_Anim"); // 动画效果对象
  89.  TFly.oX = offsetLeft;
  90.  TFly.oY = offsetTop;
  91.  TFly.alignment = alignment;
  92.  TFly.AnyIter = anyIter;
  93.  TFly.AnyTime = anyTime;
  94.  TFly.popupLatency = popupLatency;
  95.  TFly.hideLatency = hideLatency;
  96.  TFly.onPopup = onPopup;
  97.  TFly.onHide = onHide;
  98.  TFly.onmouseover = function() {
  99.  if (staticHover != '') { // 替换样式,并储存原来的样式
  100.      TFly.className_ = TFly.className;
  101.       TFly.className = staticHover;
  102.     }
  103.  TFly_Popup(TFly, true);
  104.   }
  105.  TFly.onmouseout = function() {
  106.    if (staticHover != '') { // 恢复原来的样式
  107.      TFly.className = TFly.className_;
  108.     }
  109.     TFly_Popup(TFly, false);
  110.   }
  111.  if (document.all) {
  112.  TFly.onactivate = TFly.onmouseover;
  113.  TFly.ondeactivate = TFly.onmouseout;
  114.  } else {
  115.  TFly.onfocus = TFly.onmouseover;
  116.  TFly.onblur = TFly.onmouseout;
  117.  }
  118.  TFly.DT.onmouseover = function() {
  119.  if (popupHover != '') {
  120.      TFly.DT.className_ = TFly.DT.className;
  121.       TFly.DT.className = popupHover;
  122.     }
  123.     TFly_Popup(TFly, true);
  124.   }
  125.  TFly.DT.onmouseout = function() {
  126.    if (popupHover != '') {
  127.  TFly.DT.className = TFly.DT.className_;
  128.     }
  129.    TFly_Popup(TFly, false);
  130.  }
  131.  TFly_CallClientFunction(onInit, TFly);
  132. }
  133. // 调用初始化程序
  134. function TFly_CallClientFunction(name, TFly) {
  135.  if (name != null && name != "")
  136.  eval(name + "(TFly);");
  137. }
  138. // 定位
  139. function TFly_SetPosition(TFly, obj) {
  140.  obj.style.top = TFly.oY + TFly.offsetHeight + "px";
  141.  obj.style.left = TFly.oX + (TFly.offsetWidth - obj.offsetWidth ) * (1 + TFly.alignment) / 2 + "px";
  142. }
  143. function TFly_Popup(TFly, value) {
  144.  if (TFly.timer != null) window.clearTimeout(TFly.timer); // 清除超时
  145.  if (value) { // 判断状态
  146.  if (TFly.status == "on"return;
  147.  // 如果 popup 已经显示,则显示延时为 0
  148.     // 例如从一个菜单移动到另外一个菜单
  149.     var timeout = (TFly.status == "active") ? 0 : TFly.popupLatency;
  150.  if (TFly.AnyIter > 0 && TFly.AnyTime > 0)
  151.  TFly.timer = window.setTimeout(function() {TFly_AnimateStart(TFly, true, TFly.F.curIter);}, timeout);
  152.  else
  153.  TFly.timer = window.setTimeout(function() {TFly_SetVisibility(TFly, true);}, timeout);
  154.  } else {
  155.  if (TFly.status == "off"return;
  156.  var timeout = (TFly.status == "active") ? 0 : TFly.hideLatency;
  157.  if (TFly.AnyIter > 0 && TFly.AnyTime > 0)
  158.  TFly.timer = window.setTimeout(function() {TFly_AnimateStart(TFly, false, TFly.F.curIter);}, timeout);
  159.  else
  160.  TFly.timer = window.setTimeout(function() {TFly_SetVisibility(TFly, false);}, timeout);
  161.  }
  162. }
  163. // 设置弹出内容的可见性
  164. function TFly_SetVisibility(TFly, value) {
  165.  if (value == true) {
  166.  TFly_SetPosition(TFly, TFly.DT);
  167.  TFly.DT.style.visibility = "visible";
  168.  TFly.style.zIndex = "999";
  169.  } else {
  170.  TFly.DT.style.visibility = "hidden";
  171.  TFly.style.zIndex = "0";
  172.  TFly.DT.style.left = "-10000px";
  173.  }
  174. }
  175. function TFly_AnimateStart (TFly, inout, curIter) {
  176.  if (TFly.F.timer != null) window.clearTimeout(TFly.F.timer);
  177.  if (curIter == null) curIter=0;
  178.  if (TFly.status != "active") {
  179.  TFly.status = "active";
  180.  TFly.F.style.visibility = "visible";
  181.  TFly.DT.style.visibility = "hidden";
  182.  }
  183.  if (curIter < 0 || curIter > TFly.AnyIter) {
  184.  TFly.F.curIter = (curIter < 1) ? 0 : TFly.AnyIter;
  185.  TFly.status = (TFly.F.curIter == TFly.AnyIter) ? "on""off";
  186.  TFly.F.style.visibility = "hidden";
  187.  TFly_SetPosition(TFly, TFly.DT);
  188.  TFly.style.zIndex = (TFly.F.curIter == TFly.AnyIter) ? "999" : "0";
  189.  if (TFly.F.curIter == TFly.AnyIter) {
  190.  TFly.status = "on";
  191.  TFly_SetVisibility(TFly, true);
  192.  TFly_CallClientFunction(TFly.onPopup, TFly);
  193.  } else {
  194.  TFly.status = "off";
  195.  TFly_SetVisibility(TFly, false);
  196.  TFly_CallClientFunction(TFly.onHide, TFly);
  197.  }
  198.  } else {
  199.  var per = curIter * (95 / TFly.AnyIter) + 5;
  200.  TFly.F.style.visibility = "hidden";
  201.  TFly.F.style.width = TFly.DT.offsetWidth / 100 * per + "px";
  202.  TFly.F.style.height = TFly.DT.offsetHeight / 100 * per + "px";
  203.  TFly_SetPosition(TFly, TFly.F);
  204.  TFly.F.style.visibility = "visible";
  205.  var timeout = (per == 100 ) ? 0 : TFly.AnyTime - (TFly.AnyTime / (TFly.AnyIter) * (curIter));
  206.  curIter += (inout) ? 1 : -1;
  207.  TFly.F.timer = window.setTimeout(function() {TFly_AnimateStart(TFly, inout, curIter)}, timeout);
  208.  TFly.F.curIter = curIter;
  209.  }
  210. }
  211. </script>
  212. </head>
  213. <body>
  214.           
  215. <div style="display:inline;vertical-align:middle">
  216.   <div class="LocaleManagementFlyoutStatic_msdn" style="position:relative;" id="LocaleManagement">
  217.     <a class="LocaleManagementFlyoutStaticLink_msdn" href="javascript:void(0)">United States - English </a><img class="LocaleManagementFlyoutPopArrow" src="http://msdn2.microsoft.com/msdn/Controls/UserRecognitionFlyout/en-us/popdownarrow-msdn-left.gif" alt="Dropdown Arrow" style="height:4px;width:7px;border-width:0px;" /><div id="LocaleManagement_Popup" class="LocaleManagementFlyoutPopup" style="position: absolute;visibility:hidden;left:-65534px;">
  218.       <table border="0" style="width:175px;">
  219.         <tr>
  220.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl05','')">Australia (English)</a></td>
  221.         </tr><tr>
  222.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl06','')">Brasil (Portugués)</a></td>
  223.         </tr><tr>
  224.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl07','')">Canada (English)</a></td>
  225.         </tr><tr>
  226.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl08','')">Canada (Fran?ais)</a></td>
  227.         </tr><tr>
  228.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl09','')">中国 (简体中文)</a></td>
  229.         </tr><tr>
  230.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl10','')">Deutschland (Deutsch)</a></td>
  231.         </tr><tr>
  232.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl11','')">France (Fran?ais)</a></td>
  233.         </tr><tr>
  234.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl12','')">India (English)</a></td>
  235.         </tr><tr>
  236.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl13','')">Россия (Pусский)</a></td>
  237.         </tr><tr>
  238.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl14','')">United Kingdom (English)</a></td>
  239.         </tr><tr>
  240.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl15','')">United States (English)</a></td>
  241.         </tr><tr>
  242.           <td class="LocaleManagementFlyoutPopupHr"></td>
  243.         </tr><tr>
  244.       
  245.             <td><a href="#" target=_blank>更多</a></td>
  246.         </tr>
  247.       </table></div>
  248.       <div id="LocaleManagement_Anim" class="TFlyPopupAnimate"></div>
  249.   </div>
  250.   
  251. </div>
  252. <script>
  253. TFly_Init('LocaleManagement', 0, 0, -1, 2, 60, 'LocaleManagementFlyoutStaticHover_msdn''', 100, 400, '''''');
  254. </script>
  255. </body>
  256. </html>

再来一个例子

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>MSND menu</title>
  5. <meta name="Generator" content="EditPlus">
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  7. <meta name="Author" content="">
  8. <meta name="Keywords" content="">
  9. <meta name="Description" content="">
  10. <style>
  11. .LocaleManagementFlyoutPopup {
  12.  font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
  13.   border:1px solid #666666;
  14.   padding: 3px 3px 3px 3px;
  15.   text-align: left;
  16.   background-color: #FFFFFF;
  17.   z-index: 10;
  18.   opacity: .95;
  19.   filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2,OffY=2,Color='silver',Positive='true') alpha(opacity=95);
  20. }
  21. .LocaleManagementFlyoutPopup A, .LocaleManagementFlyoutPopup A:visited {
  22.   font-size: 10px;
  23.   color: #000000;
  24.   cursor: hand;
  25.   border: 1px solid #FFFFFF;
  26.   padding: 1px 3px 1px 3px;
  27.   height: 15px;
  28.   text-align: left;
  29.   text-decoration: none;
  30.   white-space: nowrap;
  31.   display: block;
  32. }
  33. .LocaleManagementFlyoutPopup A:hover {
  34.   background-color: #f0f7fd;
  35.   color: #000000;
  36.   cursor: hand;
  37.   border: 1px solid #addbef;
  38.   padding: 1px 3px 1px 3px;
  39.   height: 15px;
  40.   text-decoration: none;
  41.   white-space: nowrap;
  42.   display: block;
  43. }
  44. .LocaleManagementFlyoutPopupHr {
  45.  height: 1px;
  46.  background: #d0e0f0;
  47.  margin: 0px 11px 21px 11px;
  48. }
  49. .LocaleManagementFlyoutPopArrow {
  50.   margin: 4px 0px 0px 0px;
  51. }
  52. .LocaleManagementFlyoutStatic_msdn {
  53.  border: 1px solid #ffffff;
  54. }
  55. .LocaleManagementFlyoutStaticHover_msdn {
  56.  border: 1px solid #addbef;
  57. }
  58. .TFlyPopupAnimate {
  59.  position: absolute;
  60.  display: block;
  61.  border: 1px solid gray;
  62.  overflow: hidden;
  63.  visibility: hidden;
  64.  margin: 0;
  65.  padding: 0;
  66.  z-index: 1;
  67. }
  68. </style>
  69. <script>
  70. /*
  71. name 对象的 id 值
  72. offsetLeft 定位:左 - 偏移量
  73. offsetTop 定位:顶部 - 偏移量
  74. alignment 对齐方式{-1: left; 0: center; 1: right}
  75. anyIter 显示方式(<=0: 普通样式; >0: 缩放样式)
  76. anyTime 动画时间间隔
  77. staticHover 鼠标覆盖时的样式
  78. popupHover 显示内容鼠标覆盖时的样式
  79. popupLatency 显示内容延时
  80. hideLatency 隐藏内容延时
  81. onInit 初始化
  82. onPopup 显示内容时行为
  83. onHide 隐藏内容时行为
  84. */
  85. function TFly_Init(name, offsetLeft, offsetTop, alignment, anyIter, anyTime, staticHover, popupHover, popupLatency, hideLatency, onInit, onPopup, onHide) {
  86.  var TFly = document.getElementById(name);
  87.  TFly.DT = document.getElementById(name + "_Popup"); // 显示内容对象
  88.  TFly.F = document.getElementById(name + "_Anim"); // 动画效果对象
  89.  TFly.oX = offsetLeft;
  90.  TFly.oY = offsetTop;
  91.  TFly.alignment = alignment;
  92.  TFly.AnyIter = anyIter;
  93.  TFly.AnyTime = anyTime;
  94.  TFly.popupLatency = popupLatency;
  95.  TFly.hideLatency = hideLatency;
  96.  TFly.onPopup = onPopup;
  97.  TFly.onHide = onHide;
  98.  TFly.onmouseover = function() {
  99.  if (staticHover != '') { // 替换样式,并储存原来的样式
  100.      TFly.className_ = TFly.className;
  101.       TFly.className = staticHover;
  102.     }
  103.  TFly_Popup(TFly, true);
  104.   }
  105.  TFly.onmouseout = function() {
  106.    if (staticHover != '') { // 恢复原来的样式
  107.      TFly.className = TFly.className_;
  108.     }
  109.     TFly_Popup(TFly, false);
  110.   }
  111.  if (document.all) {
  112.  TFly.onactivate = TFly.onmouseover;
  113.  TFly.ondeactivate = TFly.onmouseout;
  114.  } else {
  115.  TFly.onfocus = TFly.onmouseover;
  116.  TFly.onblur = TFly.onmouseout;
  117.  }
  118.  TFly.DT.onmouseover = function() {
  119.  if (popupHover != '') {
  120.      TFly.DT.className_ = TFly.DT.className;
  121.       TFly.DT.className = popupHover;
  122.     }
  123.     TFly_Popup(TFly, true);
  124.   }
  125.  TFly.DT.onmouseout = function() {
  126.    if (popupHover != '') {
  127.  TFly.DT.className = TFly.DT.className_;
  128.     }
  129.    TFly_Popup(TFly, false);
  130.  }
  131.  TFly_CallClientFunction(onInit, TFly);
  132. }
  133. // 调用初始化程序
  134. function TFly_CallClientFunction(name, TFly) {
  135.  if (name != null && name != "")
  136.  eval(name + "(TFly);");
  137. }
  138. // 定位
  139. function TFly_SetPosition(TFly, obj) {
  140.  obj.style.top = TFly.oY + TFly.offsetHeight + "px";
  141.  obj.style.left = TFly.oX + (TFly.offsetWidth - obj.offsetWidth ) * (1 + TFly.alignment) / 2 + "px";
  142. }
  143. function TFly_Popup(TFly, value) {
  144.  if (TFly.timer != null) window.clearTimeout(TFly.timer); // 清除超时
  145.  if (value) { // 判断状态
  146.  if (TFly.status == "on"return;
  147.  // 如果 popup 已经显示,则显示延时为 0
  148.     // 例如从一个菜单移动到另外一个菜单
  149.     var timeout = (TFly.status == "active") ? 0 : TFly.popupLatency;
  150.  if (TFly.AnyIter > 0 && TFly.AnyTime > 0)
  151.  TFly.timer = window.setTimeout(function() {TFly_AnimateStart(TFly, true, TFly.F.curIter);}, timeout);
  152.  else
  153.  TFly.timer = window.setTimeout(function() {TFly_SetVisibility(TFly, true);}, timeout);
  154.  } else {
  155.  if (TFly.status == "off"return;
  156.  var timeout = (TFly.status == "active") ? 0 : TFly.hideLatency;
  157.  if (TFly.AnyIter > 0 && TFly.AnyTime > 0)
  158.  TFly.timer = window.setTimeout(function() {TFly_AnimateStart(TFly, false, TFly.F.curIter);}, timeout);
  159.  else
  160.  TFly.timer = window.setTimeout(function() {TFly_SetVisibility(TFly, false);}, timeout);
  161.  }
  162. }
  163. // 设置弹出内容的可见性
  164. function TFly_SetVisibility(TFly, value) {
  165.  if (value == true) {
  166.  TFly_SetPosition(TFly, TFly.DT);
  167.  TFly.DT.style.visibility = "visible";
  168.  TFly.style.zIndex = "999";
  169.  } else {
  170.  TFly.DT.style.visibility = "hidden";
  171.  TFly.style.zIndex = "0";
  172.  TFly.DT.style.left = "-10000px";
  173.  }
  174. }
  175. function TFly_AnimateStart (TFly, inout, curIter) {
  176.  if (TFly.F.timer != null) window.clearTimeout(TFly.F.timer);
  177.  if (curIter == null) curIter=0;
  178.  if (TFly.status != "active") {
  179.  TFly.status = "active";
  180.  TFly.F.style.visibility = "visible";
  181.  TFly.DT.style.visibility = "hidden";
  182.  }
  183.  if (curIter < 0 || curIter > TFly.AnyIter) {
  184.  TFly.F.curIter = (curIter < 1) ? 0 : TFly.AnyIter;
  185.  TFly.status = (TFly.F.curIter == TFly.AnyIter) ? "on""off";
  186.  TFly.F.style.visibility = "hidden";
  187.  TFly_SetPosition(TFly, TFly.DT);
  188.  TFly.style.zIndex = (TFly.F.curIter == TFly.AnyIter) ? "999" : "0";
  189.  if (TFly.F.curIter == TFly.AnyIter) {
  190.  TFly.status = "on";
  191.  TFly_SetVisibility(TFly, true);
  192.  TFly_CallClientFunction(TFly.onPopup, TFly);
  193.  } else {
  194.  TFly.status = "off";
  195.  TFly_SetVisibility(TFly, false);
  196.  TFly_CallClientFunction(TFly.onHide, TFly);
  197.  }
  198.  } else {
  199.  var per = curIter * (95 / TFly.AnyIter) + 5;
  200.  TFly.F.style.visibility = "hidden";
  201.  TFly.F.style.width = TFly.DT.offsetWidth / 100 * per + "px";
  202.  TFly.F.style.height = TFly.DT.offsetHeight / 100 * per + "px";
  203.  TFly_SetPosition(TFly, TFly.F);
  204.  TFly.F.style.visibility = "visible";
  205.  var timeout = (per == 100 ) ? 0 : TFly.AnyTime - (TFly.AnyTime / (TFly.AnyIter) * (curIter));
  206.  curIter += (inout) ? 1 : -1;
  207.  TFly.F.timer = window.setTimeout(function() {TFly_AnimateStart(TFly, inout, curIter)}, timeout);
  208.  TFly.F.curIter = curIter;
  209.  }
  210. }
  211. </script>
  212. </head>
  213. <body>
  214.           
  215. <div style="display:inline;vertical-align:middle">
  216.   <div class="LocaleManagementFlyoutStatic_msdn" style="position:relative;" id="LocaleManagement">
  217.     <a class="LocaleManagementFlyoutStaticLink_msdn" href="javascript:void(0)">United States - English </a><img class="LocaleManagementFlyoutPopArrow" src="http://msdn2.microsoft.com/msdn/Controls/UserRecognitionFlyout/en-us/popdownarrow-msdn-left.gif" alt="Dropdown Arrow" style="height:4px;width:7px;border-width:0px;" /><div id="LocaleManagement_Popup" class="LocaleManagementFlyoutPopup" style="position: absolute;visibility:hidden;left:-65534px;">
  218.       <table border="0" style="width:175px;">
  219.         <tr>
  220.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl05','')">Australia (English)</a></td>
  221.         </tr><tr>
  222.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl06','')">Brasil (Portugués)</a></td>
  223.         </tr><tr>
  224.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl07','')">Canada (English)</a></td>
  225.         </tr><tr>
  226.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl08','')">Canada (Fran?ais)</a></td>
  227.         </tr><tr>
  228.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl09','')">中国 (简体中文)</a></td>
  229.         </tr><tr>
  230.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl10','')">Deutschland (Deutsch)</a></td>
  231.         </tr><tr>
  232.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl11','')">France (Fran?ais)</a></td>
  233.         </tr><tr>
  234.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl12','')">India (English)</a></td>
  235.         </tr><tr>
  236.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl13','')">Россия (Pусский)</a></td>
  237.         </tr><tr>
  238.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl14','')">United Kingdom (English)</a></td>
  239.         </tr><tr>
  240.           <td><a href="javascript:__doPostBack('ctl00$BannerControl1$LocaleManagement$ctl00$ctl15','')">United States (English)</a></td>
  241.         </tr><tr>
  242.           <td class="LocaleManagementFlyoutPopupHr"></td>
  243.         </tr><tr>
  244.       
  245.             <td><a href="#" target=_blank>更多</a></td>
  246.         </tr>
  247.       </table></div>
  248.       <div id="LocaleManagement_Anim" class="TFlyPopupAnimate"></div>
  249.   </div>
  250.   
  251. </div>
  252. <script>
  253. TFly_Init('LocaleManagement', 0, 0, -1, 2, 60, 'LocaleManagementFlyoutStaticHover_msdn''', 100, 400, '''''');
  254. </script>
  255. </body>
  256. </html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值