jquery實(shí)現(xiàn)仿新浪微博評論滾動效果
本文實(shí)例講述了jquery實(shí)現(xiàn)仿新浪微博評論滾動效果。分享給大家供大家參考。具體如下:
這里使用jquery實(shí)現(xiàn)評論滾動效果,仿新浪微博大廳文字滾動效果,以前有不少人膜拜的效果,現(xiàn)在被模仿的到處都是啦,呵呵,今天這個仍是模仿的,評論和頭像一起向下滾動,最新的一條帶漸變淡入淡出,無縫循環(huán)向下滾動,覺得不錯的就頂下。
點(diǎn)擊此處預(yù)覽效果:
http://demo.jb51.net/js/2015/jquery-sina-scroll-pl-codes/
運(yùn)行效果如下圖所示:

具體代碼如下:
<!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>
<style>
html,body{font-family:Verdana,sans-serif; font-size:12px;}
ul{padding:0;}
a:link{text-decoration:none;}
.box {padding:30px 0 30px 0;background: #C05732;}
.box_content a {color:#E6E5CC;}
.box_content {clear:both; overflow:hidden; width:287px; padding:0 0 0 30px;}
.r_comments{position:relative; height:262px;}
.r_comments ul{list-style:none outside none; margin-left:0px; border-top:1px dashed #a04524;}
.r_comments ul li{padding:5px 0px; line-height:20px; border-bottom:1px dashed #8C391C; border-top:1px dashed #D08364;}
.r_comments li img{background:#FFF; border:1px solid#999; height:32px; float:left; padding:1px; margin:4px 4px 0 0;}
</style>
</head>
<body>
<div class="box">
<div class="box_content r_comments">
<ul style="margin-top: 0px;" id="rcslider">
<li style="opacity: 0.6;"><img alt="公元零零零000" src="images/0.png" class="avatar avatar-32 photo" height="32" width="32"> <a href="#">零零零000:<br>
正在學(xué)習(xí)wordpress,正好找到這篇</a><br>
</li>
<li style="opacity: 0.6;"><img alt="大世界壹壹壹111" src="images/1.png" class="avatar avatar-32 photo" height="32" width="32"> <a href="#">壹壹壹111:<br>
谷歌搜了下進(jìn)來了。大牛。</a><br>
</li>
<li style="opacity: 0.6;"><img alt="天涯海角22" src="images/2.png" class="avatar avatar-32 photo" height="32" width="32"> <a href="#">貳貳貳222:<br>
嘿嘿,看了你的那篇《漂亮的評論滾動效果》</a><br>
</li>
<li style="opacity: 0.6;"><img alt="小小少年" src="images/3.png" class="avatar avatar-32 photo" height="32" width="32"> <a href="#">打跑小日本-叁叁叁333:<br>
請教個問題,使用media query后</a><br>
</li>
<li style="opacity: 0.6;"><img alt="大塊頭兒郎4" src="images/4.png" class="avatar avatar-32 photo" height="32" width="32"> <a href="#">大塊頭兒郎4:<br>
吹吧,這還挺不錯,這個可以測試一下</a><br>
</li>
</ul>
</div>
</div>
<script src="jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(function(a) {
a(function() {
var b;
a("#rcslider").hover(function() {
clearInterval(b)
},
function() {
b = setInterval(function() {
var b = a("#rcslider"),
c = b.find("li:last").height();
b.animate({
marginTop: c + 3 + "px"
},
1e3,
function() {
b.find("li:last").prependTo(b),
b.find("li:first").hide(),
b.css({
marginTop: 0
}),
b.find("li:first").fadeIn(1e3)
})
},
3e3)
}).trigger("mouseleave")
}),
a(document).ready(function() {
a("#rcslider li").css({
opacity: ".6"
}),
a("#rcslider li").hover(function() {
a(this).stop().fadeTo(300, 1)
},
function() {
a(this).stop().fadeTo(300, .6)
})
})
});
</script>
</body>
</html>
希望本文所述對大家的jquery程序設(shè)計有所幫助。
- jquery 新浪網(wǎng)易的評論塊制作
- 基于jquery實(shí)現(xiàn)ajax無刷新評論
- jQuery實(shí)現(xiàn)的簡單無刷新評論功能示例
- jQuery 實(shí)現(xiàn)評論等級好評差評特效
- JQuery實(shí)現(xiàn)動態(tài)添加刪除評論的方法
- PHP結(jié)合jQuery實(shí)現(xiàn)的評論頂、踩功能
- jQuery基于ajax實(shí)現(xiàn)星星評論代碼
- C#使用jQuery實(shí)現(xiàn)無刷新評論提交的方法
- 基于jQuery實(shí)現(xiàn)的美觀星級評論打分組件代碼
- jQuery實(shí)現(xiàn)簡單評論區(qū)
相關(guān)文章
jquery的clone方法應(yīng)用于textarea和select的bug修復(fù)
textarea和select的值clone的時候會丟掉,在clone的時候?qū)al再重新賦值一下,如果知道這個了就加單了2014-06-06
JQuery下的Live方法和$.browser方法使用代碼
網(wǎng)站做好了,老師卻要求要3級菜單,無奈只好去做3級菜單了。這次3級菜單的思路是在原有不變的基礎(chǔ)上,對有3級菜單的ID,選擇進(jìn)入新的一個控件。在這個新的控件里用ajax去請求其3級目錄里的東西。2010-06-06
jquery如何把數(shù)組變?yōu)樽址畟鞯椒?wù)端并處理
這篇文章主要介紹了jquery如何把數(shù)組變?yōu)樽址畟鞯椒?wù)端并處理,需要的朋友可以參考下2014-04-04

