如题

解决方案 »

  1.   

    <script type='text/jscript'>
      
        window.document.onkeydown= function()
        {
            if(event.ctrlKey )
            {
                document.getElementById("div1").style.display = "";
            }else
                document.getElementById("div1").style.display = "none";
            
        }
          window.document.onkeyup= function()
        {
            
                document.getElementById("div1").style.display = "none";
            
        }
        
      </script>
      

  2.   

    捕捉onkeydown和onkeyup事件
    document.onkeydown = keydownfunction keydown(){
      if(event.keyCode==17){
        //显示你的div
      }
    }
    后面自己写了
      

  3.   

    <div id="div1" style="background-color:red;width:100px;height:100px;display:none">
    aaaa
    </div>