58同城鼠标移上去,显示具体内容的实现思路是怎么样的?是所有内容都已经加载在页面上了,还是移上去才去取出来的?

解决方案 »

  1.   

    <!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" />
    <title>无标题文档</title>
    <style>
    *{margin:0; padding:0; font-size:12px; color:#000;}
    </style>
    </head><body>
    <p id="p">111111</p>
        <div id="d" style="display:none; width:100px; height:100px; border:1px solid #000;">我是隐藏层</div>
    <script>
    document.getElementById('p').onmouseover = function(){
    document.getElementById('d').style.display = 'block';
    };
    document.getElementById('p').onmouseout = function(){
    document.getElementById('d').style.display = 'none';
    };
    </script>
    </body>
    </html>
    给你个demo   看看
      

  2.   

    北北 你沙发的真快 呵呵~~这个就类似用div模拟文字提示的效果 就是上边北北兄举得例子 我就不再舞刀弄枪了~~