基于JQuery的类似新浪微博展示信息效果的代码

2019-12-24,,

复制代码 代码如下:
<!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>Untitled Page</title>
<link rel="Stylesheet" type="text/css" href="Result-Css/reset/reset-min.css" />
<style type="text/css">
.w_con{ width:400px; height:160px; overflow:hidden; border:1px solid #333;}
#w_slid{ width:100%;}
#w_slid li{ width:100%; height:40px;}
li.a{ background:#ffc000;}
li.b{ background:#56aaff;}
li.c{ background:#0fffaa;}
li.d{ background:#0ffffa;}
li.e{ background:#ffff56;}
</style>
<script type="text/javascript" src="Result-JavaScriptOrJQuery/jquery/jquery-1.7.2.js"></script>
</head>
<body>
<div class="w_con" id="w_con">
<ul id="w_slid">
<li class="a"></li>
<li class="b"></li>
<li class="c"></li>
<li class="d"></li>
<li class="e"></li>
</ul>
</div>
<script type="text/javascript">
function slide() {
var $w_slid = $('#w_con');
console.log($w_slid);
var Timer;
$w_slid.hover(function(){
clearInterval(Timer);
},function(){
Timer = setInterval(function(){
slideFadeIn($w_slid);
},3000);
}).trigger("mouseleave");
}
function slideFadeIn(obj) {
var $self = obj.find('ul:first');
var $height = $self.find('li:first').height();
console.log($height);
$self.animate({
'marginTop':+$height+'px',
}, 1200, function () {
$self.css({ marginTop: 0 }).find("li:first").appendTo($self);
$self.find("li:first").hide();
$self.find("li:first").fadeIn("slow");
});
}
$(function () {
slide();
});
</script>
</body>
</html>

您可能感兴趣的文章:

  • jQuery实现鼠标经过时出现隐藏层文字链接的方法
  • jQuery实现鼠标单击网页文字后在文本框显示的方法
  • jQuery实现表单input中提示文字value随鼠标焦点移进移出而显示或隐藏的代码
  • jquery实现仿新浪微博带动画效果弹出层代码(可关闭、可拖动)
  • jQuery实现仿新浪微博浮动的消息提示框(可智能定位)
  • jquery实现仿新浪微博评论滚动效果
  • jQuery模拟新浪微博首页滚动效果的方法
  • 仿新浪微博返回顶部的jquery实现代码
  • 基于jQuery的模仿新浪微博时间的组件
  • 基于jquery的内容循环滚动小模块(仿新浪微博未登录首页滚动微博显示)
  • 简单易用的基于jQuery版仿新浪微博向下滚动效果(附DEMO)
  • Jquery与JS两种方法仿twitter/新浪微博 高度自适应无缝滚动实现代码
  • jQuery实现鼠标选文字发新浪微博的方法

《基于JQuery的类似新浪微博展示信息效果的代码.doc》

下载本文的Word格式文档,以方便收藏与打印。