本帖最后由 mymhcb 于 2010-05-09 18:06:20 编辑

解决方案 »

  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=gb2312" />
    <title>csdn_test</title>
    <style>
    #test{
    display:none;
    margin-top:-10px;
    }
    </style><script type="text/javascript">   
    function showUserCard(){
    document.getElementById("test").style.display = "block";
    }
    </script>  
    </head><body>
    <img src="2.jpg" onmouseover="try{showUserCard(this,'某某')}catch(ex){};"/> 
    <div id="test">
    <div><a href="http://www.baidu.com">加为好友</a></div>
        <div><a href="http://www.baidu.com">blog</a></div>
    </div>
    </body>
    </html>
    这个是非常简单的demo,其余的自己添加就可以了
      

  2.   


    谢谢回复。。但是我要的是能够变换的效果哦。。根据showUserCard(this,'某某')中的某某来改变连接的地址。。就像CSDNL论坛的效果。。该怎么改呢》?
      

  3.   


    <!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>hello</title>
    <style>
    #test{
        display:none;
        margin-top:-10px;
    }</style>
    <script>
    function showUserCard(obj,url){
    alert(url)
        document.getElementById("test").style.display = "block";
    document.getElementById("add").href = url;
    }
    </script>
    </head><body>
    <img src="3.jpg" onmouseover="try{showUserCard(this,'xxx.html')}catch(ex){};"/> 
    <div id="test">
        <div><a id="add" href="http://www.baidu.com">加为好友</a></div>
        <div><a id="blog" href="http://www.baidu.com">blog</a></div>
    </div></body>
    </html>
    动态修改href就可以了