Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

pelzar

Newbie
  
  • Posts

    3
  • Joined

  • Last visited

Everything posted by pelzar

  1. Здравствуйте. Помогите,пожалуйста. Использую модуль Filter pro, включена опция бесконечный скролл. Всё прекрасно работает. Но хотелось бы, чтобы новые товары подгружались не когда покупатель доходит до низа страницы, а по клику на кнопку, т.е. под товарами кнопка "Показать ещё 10 товаров", покупатель на неё нажимает и подгружаются эти самые 10 товаров. Вот скрипт, который подгружает эти товары: (function (a) { a.fn.endlessScroll = function (b) { var c = {bottomPixels:400, fireOnce:true, fireDelay:0, contentTarget:"", callback:function () { return true }, resetCounter:function () { setTimeout(function () { productGridAutoSet(); }, 300); return false }, ceaseFire:function () { return false }, intervalFrequency:250}; var b = a.extend({}, c, b), d = false, e = 0, f = false, g = this, h = a(".endless_scroll_inner_wrap", this), i; a(this).scroll(function () { f = true; g = this }); setInterval(function () { if (f) { f = false; if (b.ceaseFire.apply(g, [e]) === true) { return } if (g == document || g == window) { if (b.contentTarget != "" && a(b.contentTarget).length) { i = a(b.contentTarget).offset().top + a(b.contentTarget).height() - a(window).height() <= a(window).scrollTop() + b.bottomPixels } else { i = a(document).height() - a(window).height() <= a(window).scrollTop() + b.bottomPixels } } else { if (h.length == 0) { h = a(g).wrapInner('<div class="endless_scroll_inner_wrap" />').find(".endless_scroll_inner_wrap") } i = h.length > 0 && h.height() - a(g).height() <= a(g).scrollTop() + b.bottomPixels } if (i && (b.fireOnce == false || b.fireOnce == true && d != true)) { if (b.resetCounter.apply(g) === true) { e = 0 } d = true; e++; if (a.isFunction(b.beforeLoad)) { b.beforeLoad.apply(g, [e]) } b.callback.apply(g, [e, function () { if (b.fireDelay !== false || b.fireDelay !== 0) { setTimeout(function () { d = false }, b.fireDelay) } else { d = false } }]) } } }, b.intervalFrequency) } })(jQuery); var product_total = 12; var current_page = 1; var text_showing = "text_showing"; var text_loading = "text_loading"; $(".el-p").hide(); $(".el-d").show(); $(window).endlessScroll({contentTarget:"#el-s", bottomPixels:400, fireOnce:false, callback:function (a, b) { $("#filterpro_page").val(++current_page); doFilter(false, false, true); }, ceaseFire:function (a) { if (current_page >= Math.ceil(product_total / $("#filterpro_limit").val())) { return true } return false }}); Никак не могу понять, куда воткнуть функцию, которую буду вызывать при клике по кнопке, чтобы всё работало.
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.