如何实现 jquery 鼠标移上一个DIV层  显示一个text文本  移出时隐藏该text文本

解决方案 »

  1.   


    $("#div").mouseenter(function(){
         $("#text").show();
      });
      $("#div").mouseleave(function(){
        $("#text").hide();
      });
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script language="javascript" src="jquery-1.6.2.js"></script>
    <script language="javascript" >
    $(function(){
    $("#myDiv").hover(function(){
    $(this).hide(1000);
    },
    function(){
    $(this).show(1000);
    });
    });
    </script>
    <title>无标题文档</title>
    </head><body>
    <div id="myDiv" style="border:1px #FF0000 solid">Text</div>
    </body>
    </html>
      

  3.   

    把jquery的引用换成你自己jquery的位置
      

  4.   

    $(function () {
                $("#div1").mouseover(function () {
                    $(this).hide("fast");
                });
                $("#div1").mouseleave(function () {
                    $(this).show("fast");
                });
            }); 
      

  5.   

    <script type="text/javascript" src="jquery-1.3.2.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
      $("p").mouseover(function(){
        $("#txt").show();
      });
      $("p").mouseout(function(){
        $("#txt").hide();
      });
    });
    </script>
    </head>
    <body>
    <p style="background-color:#E9E9E4">请把鼠标指针移动到这个段落上。</p>
    <input type="text" id="txt">
    </body>
    </html>
      

  6.   

    你的层没有弄清楚嘛,index[1]