jquery基本功能1
<%@pagelanguage="java"pageEncoding="UTF-8"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>
<linkrel="stylesheet"type="text/css"href="../files/global.css"/>
<linkrel="stylesheet"type="text/css"href="../files/datepicker.css"/>
<style>
#note>ul>li>div{display:inline-block;width:100px;}
#note>ul>li>p{display:inline-block;width:312px;min-height:60px;padding-left:10px;line-height:16px;vertical-align:top;border-left:1pxsolid#e0e0e0;}
</style>
</head>
<body>
<!--顶栏导航--><%@includefile="../common/head.jsp"%><!--顶栏导航-->
<divid="body">
<divid="side">
<!--子导航--><%@includefile="subnav.jsp"%><!--子导航-->
<divid="control"class="box">
<h3class="open"><span><em></em></span><strong>控制面板</strong></h3>
<ul>
<li>发布时间:<iid="uploadTime"><a>未设置</a><div></div><em></em></i></li>
<li>审核状态:<iid="isVerify"><aabbr="0">待审核</a><div><aabbr="1">已通过审核</a><aabbr="2">未通过审核</a></div><em></em></i></li>
<li>优先显示:<iid="identity"><aabbr="2">全部</a><div><aabbr="1">VIP用户</a><aabbr="0">普通用户</a></div><em></em></i></li>
<li>每页数量:<iid="pageSize"><a>6</a><div><a>8</a><a>10</a></div><em></em></i></li>
</ul>
</div>
</div>
<divid="main">
<divid="note"class="boxselectable">
<h3><span><a>全选</a><spanid="count">[0/0]</span><a>重置</a></span><strong>审核»随记审核</strong></h3>
<ul></ul>
<divclass="button"><bclass="biggreen">通过全部</b><bclass="bigyellow">通过选中</b><bclass="bigred">拒绝全部</b></div>
</div>
<divid="page"></div>
</div>
<divclass="clear"></div>
</div>
<!--页脚--><%@includefile="../common/foot.jsp"%><!--页脚-->
<scripttype="text/javascript"src="../files/jquery.js"></script>
<scripttype="text/javascript"src="../files/global.js"></script>
<scripttype="text/javascript"src="../files/datepicker.js"></script>
<scripttype="text/javascript">
$(function(){
data={
pageNo:1,
pageSize:6,
uploadTime:'',
isVerify:0,
identity:2
};
$('#uploadTime>div').datepicker({onSelect:function(date){
$(this).prev().text(date);
data.uploadTime=date;
getList();
}});
$('i:not(#uploadTime)>div').on('click','a',function(){
var$a=$(this);
var$i=$a.parent().parent();
$a.replaceWith($a.parent().prev()).prependTo($i);
data[$i.attr('id')]=$a.attr('abbr')||$a.text();
getList();
});
$('.button>b').click(setList);
$('#page').on('click','b',function(){
data.pageNo=$(this).text();
getList();
});
getList();
});
//加载随记
functiongetList(){
$.load('word!viewNote.action',data,function(obj){
var$ul=$('#note>ul').empty();
if(obj.totalRecords==0){
$.msg.show('没有相关数据!');
$('#page').empty();
}else{
$.each(obj.list,function(i){
$('<li/>')
.append('<div>'+this.nickName+'<br/>'+this.genderInfo+'/'+this.age+'<br/>'+this.noteTime.substr(5,11)+'</div>')
.append('<p>'+this.noteMsg+'</p>')
.data('id',this.noteId).appendTo($ul);
});
$('#page').page(obj.pageNo,obj.totalPage);
}
$('#count').next().click();
});
}
//提交当前页审核结果
functionsetList(){
vardata=$.selected($(this).index());
if(data){
$.load('w_word!updateNote.action',data,function(obj){
if(obj[0]==0){
$.msg.show('提交处理成功!',getList);
}else{
$.msg.show('提交处理失败,请重试!');
}
});
}
}
</script>
</body>
</html>