日期:2014-05-16 浏览次数:20487 次
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <package name="voteComment" extends="json-default"> <action name="saveVoteComment" class="voteCommentAction" method="saveVoteComment"> <result type="json"/> </action> <action name="loadCourseComments" class="voteCommentAction" method="loadCourseComments"> <result type="json"/> </action> <action name="loadCourseCommentsForPage" class="voteCommentAction" method="loadCourseComments"> <result type="json"/> </action> <action name="goodVote" class="voteCommentAction" method="countGoodVoteNum"> <result type="json"/> </action> <action name="badVote" class="voteCommentAction" method="countBadVoteNum"> <result type="json"/> </action> </package> </struts>
//用于处理置顶
jQuery.fn.topLink = function (settings) {
settings = jQuery.extend({min:1, fadeSpeed:200, ieOffset:38}, settings);
return this.each(function () {
//listen for scroll
var el = $(this);
el.css("display", "none"); //in case the user forgot
$(".overview").scroll(function () {
if (jQuery.support.hrefNormalized) {
el.css({"position":"absolute", "top":$(".scrollbar").height()+10,"right":settings.ieOffset});
}
if ($(".overview").height() > $(".scrollbar").height()) {
el.fadeIn(settings.fadeSpeed);
if($(".overview").css("top")=="0px"){
el.fadeOut(settings.fadeSpeed);
}
}
else{
el.fadeOut(settings.fadeSpeed);
}
});
});
};
var commentCurrentPage = 0;
var commentTotal = 0;
var commentTotalPage = 0;
var courseId = 0;
var commentPageSize = 10;
var badVoteNum = 0;
var goodVoteNum = 0;
var commentCount = 0;
$(function () {
//评论部分 开始
$(".commentsDiv").hide();
$(".showCommentA").live("click",function(){
var course_Id = $(this).attr("id");
openComment(course_Id,commentCurrentPage,commentPageSize);
});
$(".closeComment").live("click",function(){
closeComment();
});
//左边 导航菜单
$("#closeMenuDiv").click(function () {
var courseId = $(".showCommentA").eq(0).attr("id");
openComment(courseId,commentCurrentPage,commentPageSize);
});
//评论部分 结束
//底部导航 开始
$(".nav").height("4px").css("opacity", "0.4");
$(".nav").hover(function (event) {
if (event.pageY > 560) {
$(this).animate({height:"44px", opacity:1}, 1000);
}
}, function (event) {
if (event.pageY <= 605) {
$(this).animate({height:"4px", opacity:"0.4"}, 1000);
}
});
//底部导航 结束
//置顶
$("#top-link").topLink({min:1, fadeSpeed:500});
//smoothscroll
$("#top-link").click(function (e) {
e.preventDefault();//==return false;
$(".overview,.thumb").animate({top:0},10);
$(this).fadeOut(200);
});
$('.overview').mousewheel(function(event,delta) {
var temp = $(".thumb").css("top");
if(temp == "0px"){
$("#top-link").fadeOut(200);
}
});
$(".thumb").click(function(){
var temp = $(".thumb").css("top");
if(temp == "0px"){
$("#top-link").fadeOut(200);
}
});
//点击好评
$("#goodCommentDiv").live("click",function(){
var parameters = new Object();
parameters["courseId"] = courseId;
parameters["userId"] = "3";
$.post("voteComment/goodVote.action",parameters,function(data) {
alert(data.msg);
if(data.success){
$("div[title=goodCommentNum]").html(data.goodVoteNum);
}
},"json");
});
//点击差评
$("#badCommentDiv").live("click",function(){
var parameters = new Object();
parameters["courseId"] = courseId;
parameters["userId"] = "3";
$.post("voteComment/badVote.action",parameters,function(data) {
alert(data.msg);
if(data.success){
$("div[title=badCommentNum]").html(data.badVoteNum);
}
},"json");
});
//点击 评论按钮,发