= $(this).data('id'); request_data.kw = ''; $('input[name=kw]').val(''); request_data.page = 1; get_data(function(){ $('.none-loading').remove(); $('.addmore').show(); }); return false; }); $('.so-btn').click(function(){ request_data.kw = $('input[name=kw]').val(); $('#news-box').html('
'); $('.addmore').hide(); get_data(function(){ $('.none-loading').remove(); $('.addmore').show(); }); }); $('.addmore').mousedown(function(){ var me = $('.addmore'); request_data.page++; me.addClass('ax-disabled').prop('disabled', true).find('.loading').show(); get_data(function(){ me.removeClass('ax-disabled').prop('disabled', false).find('.loading').hide(); }); return false; }); function get_data(fn){ var html = $('#news-list-tmp').html(); clearTimeout(timeout); timeout = setTimeout(function(){ $.get('/api/news/bloglist', request_data, function(res){ if(res.data.list.data.length>0){ $(res.data.list.data).each(function(k,v){ var new_html = html.replace(/{id}/g, v.id) .replace(/{title}/g, v.title) .replace(/{updated_time}/g, v.updated_time) .replace(/{images}/g, v.images) .replace(/{describe}/g, v.describe); $('#news-box').append(new_html); }); }else{ $('.addmore').hide(); $('.none-loading').remove(); $('.ax-empty').parent().remove(); $('#news-box').append('
  • 没有内容
  • '); } fn(); }); }, 1000); } }(); })();