I can't see the topic as you have to log in. Any way you can give me a test account?
May 2024
Search
Who is online?
In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest
None
Most users ever online was 140 on July 4th 2021, 2:03 pm
None
Most users ever online was 140 on July 4th 2021, 2:03 pm
Most Viewed Topics
Top posting users this week
No user |
Go to page : 1, 2
Infinite Scrollers
So far I have finished the Clickable Infinite Load Post code. I will be working on the scrollable now. So please enjoy this as this has taken me some thinking of how to go about all of this
Create a new Javascript page and mark it In The Topics.
CSS needed to keep it clean
This may not be usable for each forum, if it doesn't work for your forum please let me know. And I will change the code accordingly.
Create a new Javascript page and mark it In The Topics.
- Code:
$(function() {
//Copyright 2013 EasyBB Tutorals Dot Com
//Any reference to this code, you must keep the copyright in tact.
//EasyBB (C) 2013
if(!/p\d+/.test(window.location.pathname)) {
var main =$('.post').last(),
infiniBody= '<div class="newInfini"></div>';
main.after(infiniBody);
var infini =$('.newInfini');
newInfiniHTML = '<center><span>Show More Post</span></center>',
noInfiniHTML ='<center><span>No More Post</span></center>',
hrefArray = [],//array global
pager = $('.paging'),
hrefs = $('.paging').first().find('a[href*="/t"]'),
imgUrl = "http://i79.servimg.com/u/f79/17/83/35/07/loadin10.gif";
for(var i=0;i<hrefs.length;i++) {
var hreflink = $(hrefs[i]).attr('href');
hrefArray.push(hreflink);
}
if(hrefArray.length == 0) {
infini.html(noInfiniHTML);
} else {
infini.html(newInfiniHTML);
}
hrefArray.pop();
var hrefLength = hrefArray.length,
imgS = $('.loadingImg');
function infiniteScroll(){
var url = hrefArray.shift();
setTimeout(function() {
imgS.remove();
infini.load(url+" .post",function() {
infini.removeClass('newInfini').addClass('oldInfini');
hrefLength = hrefArray.length;
main=$('.post').last();
main.after(infiniBody);
infini =$('.newInfini');
if(hrefArray.length == 0) {
infini.html(noInfiniHTML);
} else {
infini.html(newInfiniHTML);
}
});
},1500);
}
$(document).on('click',infini,function() {
if(hrefArray.length > 0) {
infini.html('<center><img class="loadingImg" src="'+imgUrl+'"/></center>');
infiniteScroll();
}
});
} else {
if(pager !== undefined) {pager.show();}
}
});
CSS needed to keep it clean
- Code:
.paging{display:none}
This may not be usable for each forum, if it doesn't work for your forum please let me know. And I will change the code accordingly.
Try changing lines 14 and 15 to this-
- Code:
pager = $('.gensmall .browse-arrows'),
hrefs = pager.first().find('a[href*="/t"]'),
Thats my code:
I created a table (class="infinitebox") to contain all the blog´s list, but dont contain the pagination... and the code dont work :/
- Code:
$(function() {
//Copyright 2013 EasyBB Tutorals Dot Com
//Any reference to this code, you must keep the copyright in tact.
//EasyBB (C) 2013
if(!/p\d+/.test(window.location.pathname)) {
var main =$('.infinitebox').last(),
infiniBody= '<div class="newInfini"></div>';
main.after(infiniBody);
var infini =$('.newInfini');
newInfiniHTML = '<center><span>Show More Post</span></center>',
noInfiniHTML ='<center><span>No More Post</span></center>';
hrefArray = [],//array global
pager = $('.pagination'),
hrefs = pager.first().find('a[href*="/t"]'),
imgUrl = "http://i79.servimg.com/u/f79/17/83/35/07/loadin10.gif";
for(var i=0;i<hrefs.length;i++) {
var hreflink = $(hrefs[i]).attr('href');
hrefArray.push(hreflink);
}
if(hrefArray.length == 0) {
infini.html(noInfiniHTML);
} else {
infini.html(newInfiniHTML);
}
hrefArray.pop();
var hrefLength = hrefArray.length,
imgS = $('.loadingImg');
function infiniteScroll(){
var url = hrefArray.shift();
setTimeout(function() {
imgS.remove();
infini.load(url+" .infinitebox",function() {
infini.removeClass('newInfini').addClass('oldInfini');
hrefLength = hrefArray.length;
main=$('.infinitebox').last();
main.after(infiniBody);
infini =$('.newInfini');
if(hrefArray.length == 0) {
infini.html(noInfiniHTML);
} else {
infini.html(newInfiniHTML);
}
});
},1500);
}
$(document).on('click',infini,function() {
if(hrefArray.length > 0) {
infini.html('<center><img class="loadingImg" src="'+imgUrl+'"/></center>');
infiniteScroll();
}
});
} else {
document.getElementsByClassName('pagination').style.display="block";
}
});
I created a table (class="infinitebox") to contain all the blog´s list, but dont contain the pagination... and the code dont work :/
Go to page : 1, 2
|
|