socialforge/public/javascripts/course.js

52 lines
1.7 KiB
JavaScript
Raw Normal View History

2015-03-17 18:02:46 +08:00
function regexName(content)
{
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#project_name_span").text(content);
$("#project_name_span").css('color','#ff0000');
$("#project_name_span").focus();
return false;
}
else
{
$("#project_name_span").text("");
return true;
}
}
function submitSerch(content)
{
if(regexName(content)){$("#course_search_form").submit();}
2015-03-18 15:18:06 +08:00
}
function show_more_msg()
{
$("#course_description").toggleClass("course_description_none");
}
function bid_show_more_des(id)
{
$("#bid_description_" + id).toggleClass("news_description_none");
}
$(document).ready(function () {
$("#RSide").css("min-height",$("#LSide").height()-30);
});
function ShowCountDown(year,month,day,divname)
{
var now = new Date();
var endDate = new Date(year, month-1, day);
var leftTime=endDate.getTime()-now.getTime();
var leftsecond = parseInt(leftTime/1000);
var day1=Math.floor(leftsecond/(60*60*24));
var hour=Math.floor((leftsecond-day1*24*60*60)/3600);
var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60);
var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60);
$("#"+divname).html("<span style='color: #acaeb1;'>作业提交还剩&nbsp;:</span>&nbsp;<span style='color: red;'>"
+day1+"&nbsp;</span><span style='color: #acaeb1;'>天</span><span style='color: red;'>&nbsp;"
+hour+"&nbsp;</span><span style='color: #acaeb1;'>时</span><span style='color: red;'>&nbsp;"
+minute+"&nbsp;</span><span style='color: #acaeb1;'>分</span><span style='color: red;'>&nbsp;"
+second+"&nbsp;</span><span style='color: #acaeb1;'>秒</span>");
}