解决方案 »
- IE 和 火狐 兼容的问题 关于iframe的!急!!!
- 使用jquery及jQuery.UI.Impromptu弹出的页面中,使用gridview,并增加checkbook和下一页,但点击后本页关闭
- 鼠标移动到隐藏DIV中的超链接时,DIV消失的问题
- @@@通过JS判断URL来显示2级菜单的问题!!!!!
- 为什么有的支持某事件的对象对这个事件不响应?比如window的onmove()
- 请问function.prototype.x和function.x有何不同?
- DREAMWEAVER上的JS调试器老是打不开,有何办法?
- radio问题
- 网页对话框如何向父窗口传递参数???
- 请问这种如何实现,我只会做两层,不会做三层的。急!!!!!!!!!
- 求助 向后台传数据的问题!!!
- setTimeout()问题
<!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,其余的自己添加就可以了
谢谢回复。。但是我要的是能够变换的效果哦。。根据showUserCard(this,'某某')中的某某来改变连接的地址。。就像CSDNL论坛的效果。。该怎么改呢》?
<!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就可以了