Esc建實現關閉窗體

MyHtml.html

<script type="text/javascript" language="javascript">// <![CDATA[ function esckeydown() { if(event.keyCode==27){ event.returnValue = null; window.returnValue = null; window.close(); } } //document.οnkeydοwn=esckeydown; function esckeydownHide() { if(event.keyCode==27){ document.getElementById('test').style.display='none'; } } document.οnkeydοwn=esckeydownHide; function test(){ document.getElementById('test').style.display='block'; } // ]]></script>
aaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaa

test

<!DOCTYPE html>
<html>
  <head>
    <title>MyHtml.html</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
  <script language="javascript">
	function esckeydown()
	{
		if(event.keyCode==27){
		   event.returnValue = null;
		   window.returnValue = null;
		   window.close();
		}
	}
	//document.οnkeydοwn=esckeydown;
	
	
	function esckeydownHide()
	{
		if(event.keyCode==27){
			
			document.getElementById('test').style.display='none';
		}
	}
	document.οnkeydοwn=esckeydownHide;
	function test(){
		document.getElementById('test').style.display='block';
	}
</script>

  </head>
  
  <body>
   	<div style="height: 200px;width: 200px;display:none" id="test">
   	aaaaaaaaaaaaaaaaaaaaaaaaaaaa
   	aaaaaaaaaaaaaa
   	aaaaaaaaaaaaaa
   	aaaaaaaaaaaaaa
   	aaaaaaaaaaaaaa
   	</div>
   	
   	<a href="javascript:void(0);" οnclick="test()">test</a>
  </body>
</html>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章