$(function() { $("img").lazyload({ effect: "fadeIn", threshold: 0, failure_limit: 25 }) }); jQuery(function() { jQuery('#dowebok').owlCarousel({ items: 3, navigation: true, navigationText: ["", ""], pagination: false, autoPlay: 3000, scrollPerPage: true }); }); jQuery(document).ready(function() { jQuery('#sidebar').stickySidebar({}); }); jQuery(document).ready(function() { var o = { speed: 1000, timeout: 3500 }; jQuery('#watch').click(function() { $.get("plugin.php?id=pubuliu:kankan", '', function(data) { jQuery('#watch').attr("href", "/article-" + data + "-1.html").text('再随便看看'); }); }); function showNext(obj, n, c) { jQuery(obj[c]).fadeOut(o.speed); jQuery(obj[n]).fadeIn(o.speed); c = n; n = (n >= obj.length - 1) ? 0 : n + 1; setTimeout(function() { showNext(obj, n, c); }, o.timeout); } jQuery('.indexsl li').click(function() { var _this = $('.indexsl li').eq($(this).index()); _this.find("a").addClass("indextab").parent().siblings().find("a").removeClass('indextab'); loadarticle(_this.attr('type'), 0, 15, 'reload'); jQuery('.paginationbutton').removeClass("bounceout") }); function loadarticle(a, b, c, d) { loadmore_btn = jQuery('.loadmore'); loadmore_btn.unbind('click').find('.disable').show().parent().find('.enable').hide(); jQuery.ajax({ url: "plugin.php?id=pubuliu:ajax", data: { mod: "loadarticle", start: b, num: c, type: a }, success: function(b) { var c = jQuery(b); if (c.length > 0) { if (d == 'reload') { var e = jQuery('.article-block').find('.isotope-item'); if (e.length) { jQuery('.article-block').isotope('remove', e) } } jQuery('.article-block').isotope('insert', c); loadmore_btn.bind('click', function() { var a = jQuery('.article-block').find('.isotope-item').length; loadarticle(jQuery('.indextab').parent().attr('type'), a, 12, 'add'); }).find('.enable').show().parent().find('.disable').hide(); $("img.ajimg").lazyload({ effect: "fadeIn", threshold: 400 }).removeClass("ajimg"); } else { jQuery('.paginationbutton').addClass("bounceout") } } }); } window.onload = function() { jQuery('.loadmore').find('.disable').hide().parent().find('.enable').show(); $.get("plugin.php?id=pubuliu:kankan", '', function(data) { jQuery('#watch').attr("href", "/article-" + data + "-1.html"); }); } jQuery('.loadmore').click(function() { var itemcount = jQuery('.article-block').find('.isotope-item').length; loadarticle(jQuery('.indextab').parent().attr('type'), itemcount, 12, 'add'); }); });