This commit is contained in:
suntao 2015-09-01 16:30:36 +08:00
commit 73d0e675c1
3 changed files with 3 additions and 14 deletions

View File

@ -72,6 +72,7 @@
<input type="hidden" name="homework_type" value="1">
</div>
</div>
<div class="cl"></div>

View File

@ -53,4 +53,5 @@
</div><!----HomeWork end-->
<% end%>
<input type="hidden" value="<%= page%>" id="user_show_more_homework" />
<input type="hidden" value="<%= page%>" />
<%= link_to "加载更多",user_homeworks_user_path(User.current.id),:id => "user_show_more_homework",:remote => "true",:class => "loadMore mt10 f_grey"%>

View File

@ -1,17 +1,4 @@
<script type="text/javascript">
var scrollHandler = function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
$.get(
'<%= user_homeworks_user_path(User.current.id)%>',
{ page : $("#user_show_more_homework").val()},
function (data) {
}
);
}
};
$(window).scroll(scrollHandler);
function reset_homework(){
$("#homework_name").val("");
$("#homework_end_time").val("<%= (Time.now + 3600 * 24).strftime('%Y-%m-%d')%>");