87,904
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML>
<html>
<head>
<title>jQuery SlideDown() / SlideUp()</title>
<style type="text/css">
.text {
float: left;
position: relative;
overflow: hidden;
width:300px;
height:200px;
}
.title {
position: absolute;
top: 0px;
left: 0px;
display: none;
background-color: black;
color: white;
padding: 10px;
width: 100%;
height: 80px;
z-index: 10;
}
</style>
<script type="text/javascript" src="jquery.1.61.js"></script>
<script type="text/javascript">
(function( $ ){
$('.text').live('mouseenter',function() {
$(this).find('.title').slideDown(500);
});
$('.title').live('mouseenter',function() {
$(this).css("display","block");
});
$('.text').live('mouseout',function() {
$(this).find('.title').slideUp(500);
});
})(jQuery);
</script>
</head>
<body>
<div class="text">
Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text. Main text.
<span class="title">title text. title text. title text. title text. title text. title text. title text. title text.</span>
</div>
</body>
</html>