<div style=" width:500px; height:53px; border:solid 1px red;">
<br />
  <div  style="width:300px; height:30px; border:solid 1px gay; position:relative;">
  <input type="text" id="ts" onclick='$("#getTb").show();' />
    <div id="getTb" style="width:300px; height:250px; border:solid 1px green; position:absolute; top:1px; left:1px; display:none; background-color:White; "></div>
  </div>
  </div>现在是点了ts弹出层getTb了,但我想鼠标点在getTb不关闭,但电子getTb 这div外就hide() 这getTb怎么写呢。谢谢

解决方案 »

  1.   

    抢分
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" ></script>
    <div style=" width:500px; height:53px; border:solid 1px red;">
    <br />
      <div  style="width:300px; height:30px; border:solid 1px gay; position:relative;">
      <input type="text" id="ts" onclick='$("#getTb").show();' onblur='$("#getTb").hide();'/>
        <div id="getTb" style="width:300px; height:250px; border:solid 1px green; position:absolute; top:1px; left:1px; display:none; background-color:White; "> </div>
      </div>
      </div> 
      

  2.   

    document.body.onclick = function(event)
    {
        var obj;
        if (document.all)
        {
            obj = window.event.srcElement;
        }
        else
        {
            obj = event.target;
        }
        if (obj.id == 'getTab')
        {
            return;     
        }
        else
        {
            //隐藏
        }
    }
      

  3.   

    to:windzjp
    因为要移开input的焦点,这样就隐藏不行了。
    要在弹出的div里操作的。to:reedseutozte试了不行呢。