求解JQ代码~~~~

q510473863 2011-12-30 03:26:33
<!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>
<script src="js/jquery-1.4.2.min.js"></script>
<script>
$(function(){
$("#touxiang").mousemove(function(){
$("#ttt").show();
})
})
</script>
<style type="text/css">
.tx_img{width:150px;}
.tx_img img{ float:left; max-width:140px; max-height:140px;}
.tx_list{position:absolute; left:0px; top:0px; z-index:100; width:170px; display:none; border:1px solid #ccc;}
.tx_img2{float:right; clear:right; width:10px; height:150px; background-color:#ccc;}
</style>
</head>

<body>
<div id="touxiang" class="tx_img">
<img src="images/untitled.bmp" />
</div>
<div id="ttt" class="tx_list">
<div class="tx_img2">
+
</div>
</div>

</body>
</html>
主要实现鼠标移上去显示灰色部分。就像是菜单一样悬停。鼠标移开灰色部分隐藏了
...全文
117 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
风知 2011-12-30
  • 打赏
  • 举报
回复
<!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>
<script src="js/jquery-1.4.2.min.js"></script>
<script>
$(function(){
$("#touxiang").hover(function(){
$("#ttt").show();
},function(){$("#ttt").hide();})
})
</script>
<style type="text/css">
.tx_img{width:150px;}
.tx_img img{ float:left; max-width:140px; max-height:140px;}
.tx_list{position:absolute; left:0px; top:0px; z-index:100; width:170px; display:none; border:1px solid #ccc;}
.tx_img2{float:right; clear:right; width:10px; height:150px; background-color:#ccc;}
</style>
</head>

<body>
<div id="touxiang" class="tx_img">
<img src="images/untitled.bmp" />
</div>
<div id="ttt" class="tx_list">
<div class="tx_img2">
+
</div>
</div>

</body>
</html>

要这个效果?
三石-gary 2011-12-30
  • 打赏
  • 举报
回复

<!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>
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#imgLeave").mousemove(function (e) {
$("#divDetails").css("top", e.pageY).css("left", e.pageX).show("slow");
});

$("#imgLeave").mouseleave(function () {
$("#divDetails").hide();
});
$("#divDetails").mouseleave(function () {
$("#divDetails").hide();
});

})
</script>
</head>
<body>
<img src="images/1.jpg" width="160" height="120" id="imgLeave"/>
<div id="divDetails" style="display: none; position: absolute; border-color: Green;
border-width: 1px; border-style: solid; background-color: Yellow;">
<p>
图片名称:扣扣秀</p>
<p>
所属人:无相</p>
</div>
</body>
</html>

like this?
q510473863 2011-12-30
  • 打赏
  • 举报
回复
这效果可以。但是我想要是Flickr Blog你头像鼠标移上去的效果
三石-gary 2011-12-30
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 q510473863 的回复:]

还是不行。
[/Quote]
可以啊。。。鼠标移上去显示。。移开就隐藏了。。不明白你为什么不行
q510473863 2011-12-30
  • 打赏
  • 举报
回复
还是不行。
三石-gary 2011-12-30
  • 打赏
  • 举报
回复
<script>
$(function () {
$("#touxiang").mousemove(function () {
$("#ttt").show();
});
$("#touxiang").mouseleave(function () {
$("#ttt").hide();
})
})
</script>

61,129

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧