Works for me on my local instance of vB5. What browser are you using? Can you post a link?
AJAX Paging
Collapse
X
-
-
Hi,
It works. but the ajax will start to work in a scenario of enter the page number in the input field, hit enter. After that pages are loading through ajax. Same effect in Firefox and chrome. Please try the scenario. ThanksComment
-
Comment
-
Try this updated code:
Code:<script> $(function() { $(window).on('load', function () { $('.pagenav-form .arrow[href]').off('click').on('click', function(e) { return true; }); $('.js-pagenum').off('keypress').on('keypress', function (e) { var pageNum = Number($(this).val()), currentPageNum = Number($(this.form).find('.defaultpage').val()); if (e.keyCode === 13) { e.preventDefault(); if (pageNum !== currentPageNum) { location.href = vBulletin.makePaginatedUrl(location.href, pageNum); } } }); }); $('.js-pagenav-button[href]').on('click', function(e) { e.stopImmediatePropagation(); }); }); </script>
Comment
-
Hi Glenn Vergara, I tried this on my test site in 5.3.1 and the last version of the code seems to work except when the page n° buttons belox the threads are clocked, in this case the page is loaded in ajax.
I am not 100% sure i want to go there but sure ajax implementation reduces the n° of ad impressions in a big way...
Edit : I think i got it right :
Code:<script> $(function() { $(window).on('load', function () { $('.pagenav-form .arrow[href]').off('click').on('click', function(e) { return true; }); $('.js-pagenum').off('keypress').on('keypress', function (e) { var pageNum = Number($(this).val()), currentPageNum = Number($(this.form).find('.defaultpage').val()); if (e.keyCode === 13) { e.preventDefault(); if (pageNum !== currentPageNum) { location.href = vBulletin.makePaginatedUrl(location.href, pageNum); } } }); $('.js-pagenav-button[href]').on('click', function(e) { e.stopImmediatePropagation(); }); }); }); </script>
Last edited by plongeur.com; Fri 11 Aug '17, 7:07am.Comment
-
Glad the latest code works for you.Comment
-
Hi, note that i changed it to include the last part in the function. Pagenav button would not work otherwise.
Just for info, it bugs one the who's online page, and i just can't see any other page than the first one. I never really use it so it is nothing big but it is worth noticing.Comment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment