课程作业描述很长时才显示更多按钮

This commit is contained in:
sw 2015-03-25 14:34:20 +08:00
parent 6c5cf50bf0
commit 7b379456ed
2 changed files with 21 additions and 7 deletions

View File

@ -27,9 +27,20 @@
<%= student_new_homework bid %> <%= student_new_homework bid %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<p id="bid_description_<%= bid.id%>" class="news_description mt5"> <script>
<%= textilizable bid, :description %> $(function(){
<div class="news_foot c_red" onclick="bid_show_more_des(<%= bid.id%>);" style="cursor:pointer;"> if($("#bid_description_<%= bid.id%>_content").height()>38)
{
$("#bid_show_more_des_button<%= bid.id%>").show();
}
});
</script>
<div id="bid_description_<%= bid.id%>" class="news_description mt5">
<div id="bid_description_<%= bid.id%>_content">
<%= textilizable bid, :description %>
</div>
</div>
<div class="news_foot c_red" id="bid_show_more_des_button<%= bid.id%>" onclick="bid_show_more_des(<%= bid.id%>);" style="cursor:pointer;display: none;">
<%= l(:button_more)%>... <%= l(:button_more)%>...
<span class="g-arr-down"></span> <span class="g-arr-down"></span>
</div> </div>

View File

@ -34,10 +34,7 @@ function bid_show_more_des(id)
{ {
$("#bid_description_" + id).toggleClass("news_description_none"); $("#bid_description_" + id).toggleClass("news_description_none");
} }
//将右侧的最小高度设置成左侧高度,美化界面
$(document).ready(function () {
$("#RSide").css("min-height",$("#LSide").height()-30);
});
//课程作业结束时间倒计时 //课程作业结束时间倒计时
function show_bid_dead_line(year,month,day,divname) function show_bid_dead_line(year,month,day,divname)
{ {
@ -152,9 +149,15 @@ function hidden_atert_form(cur_page,cur_type)
hideModal($("#popbox")); hideModal($("#popbox"));
} }
//当课程描述长度小于112px时不显示更多按钮
$(function(){ $(function(){
if($("#course_description_content").height()>112) if($("#course_description_content").height()>112)
{ {
$("#lg-foot").show(); $("#lg-foot").show();
} }
});
//将右侧的最小高度设置成左侧高度,美化界面
$(document).ready(function () {
$("#RSide").css("min-height",$("#LSide").height()-30);
}); });