Jquery隐藏式评论

<!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>隐藏式评论</title> <mce:script type="text/javascript" src="jquery.js" mce_src="jquery.js"></mce:script> <mce:script type="text/javascript"><!-- $(document).ready(function(){ //hide message_body after the first one $(".message_list .message_body:gt(0)").hide(); //hide message li after the 5th $(".message_list li:gt(4)").hide(); //toggle message_body $(".message_head").click(function(){ $(this).next(".message_body").slideToggle(500) return false; }); //collapse all messages $(".collpase_all_message").click(function(){ $(".message_body").slideUp(500) return false; }); //show all messages $(".show_all_message").click(function(){ $(this).hide() $(".show_recent_only").show() $(".message_list li:gt(4)").slideDown() return false; }); //show recent messages only $(".show_recent_only").click(function(){ $(this).hide() $(".show_all_message").show() $(".message_list li:gt(4)").slideUp() return false; }); }); // --></mce:script> <mce:style type="text/css"><!-- * { margin: 0; padding: 0; } body { margin: 10px auto; width: 570px; font: 75%/120% Arial, Helvetica, sans-serif; } p { padding: 0 0 1em; } /* message display page */ .message_list { list-style: none; margin: 0; padding: 0; width: 383px; } .message_list li { padding: 0; margin: 0; background: url(images/message-bar.gif) no-repeat; } .message_head { padding: 5px 10px; cursor: pointer; position: relative; } .message_head .timestamp { color: #666666; font-size: 95%; position: absolute; right: 10px; top: 5px; } .message_head cite { font-size: 100%; font-weight: bold; font-style: normal; } .message_body { padding: 5px 10px 15px; } .collapse_buttons { text-align: right; border-top: solid 1px #e4e4e4; padding: 5px 0; width: 383px; } .collapse_buttons a { margin-left: 15px; float: right; } .show_all_message { background: url(images/tall-down-arrow.gif) no-repeat right center; padding-right: 12px; } .show_recent_only { display: none; background: url(images/tall-up-arrow.gif) no-repeat right center; padding-right: 12px; } .collpase_all_message { background: url(images/collapse-all.gif) no-repeat right center; padding-right: 12px; color: #666666; } --></mce:style><style type="text/css" mce_bogus="1"> * { margin: 0; padding: 0; } body { margin: 10px auto; width: 570px; font: 75%/120% Arial, Helvetica, sans-serif; } p { padding: 0 0 1em; } /* message display page */ .message_list { list-style: none; margin: 0; padding: 0; width: 383px; } .message_list li { padding: 0; margin: 0; background: url(images/message-bar.gif) no-repeat; } .message_head { padding: 5px 10px; cursor: pointer; position: relative; } .message_head .timestamp { color: #666666; font-size: 95%; position: absolute; right: 10px; top: 5px; } .message_head cite { font-size: 100%; font-weight: bold; font-style: normal; } .message_body { padding: 5px 10px 15px; } .collapse_buttons { text-align: right; border-top: solid 1px #e4e4e4; padding: 5px 0; width: 383px; } .collapse_buttons a { margin-left: 15px; float: right; } .show_all_message { background: url(images/tall-down-arrow.gif) no-repeat right center; padding-right: 12px; } .show_recent_only { display: none; background: url(images/tall-up-arrow.gif) no-repeat right center; padding-right: 12px; } .collpase_all_message { background: url(images/collapse-all.gif) no-repeat right center; padding-right: 12px; color: #666666; } </style> </head> <body> <ol class="message_list"> <li> <p class="message_head"><cite>corange.cn</cite> <span class="timestamp">ASP,PHP,JSP,JS,ASP.NET,div,CSS等网站建设相关技术</span></p> <div class="message_body"> <p>ASP,PHP,JSP,JS,ASP.NET,div,CSS等网站建设相关技术,<br /> <br /> ASP,PHP,JSP,JS,ASP.NET,div,CSS等网站建设相关技术</p> </div> </li> <li> <p class="message_head"><cite>nick:</cite> <span class="timestamp">2 minutes ago</span></p> <div class="message_body"> <p>message here</p> </div> </li> <li> <p class="message_head"><cite>someone:</cite> <span class="timestamp">1 day ago</span></p> <div class="message_body"> <p>message here</p> </div> </li> <li> <p class="message_head"><cite>nick:</cite> <span class="timestamp">2 days ago</span></p> <div class="message_body"> <p>message here</p> </div> </li> <li> <p class="message_head"><cite>someone:</cite> <span class="timestamp">3 days ago</span></p> <div class="message_body"> <p>message here</p> </div> </li> <li> <p class="message_head"><cite>nick:</cite> <span class="timestamp">5 days ago</span></p> <div class="message_body"> <p>message here</p> </div> </li> <li> <p class="message_head"><cite>someone:</cite> <span class="timestamp">6 days ago</span></p> <div class="message_body"> <p>message here</p> </div> </li> <li> <p class="message_head"><cite>nick:</cite> <span class="timestamp">7 days ago</span></p> <div class="message_body"> <p>message here</p> </div> </li> </ol> <p class="collapse_buttons"><a href="#" mce_href="#" class="show_all_message">显示全部 (8)</a> <a href="#" mce_href="#" class="show_recent_only">显示5条信息</a> <a href="#" mce_href="#" class="collpase_all_message">收起全部</a></p> <br /> <br><br> <div align="center"> </div> </body> </html> http://www.corange.cn//uploadfiles/images_36155.rar 原文地址:http://www.corange.cn/archives/2010/04/3592.html   

转载于:https://www.cnblogs.com/ajuanabc/archive/2010/04/18/2462743.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值