The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Load more topics query problem!

3 posters

Go down

Solved Load more topics query problem!

Post by udarsha45 October 25th 2016, 8:33 am

http://www.punbb.biz/t841-javascript-load-more-topics-query

I tried adding the code above, however the feature doesn't seem to be appearing...

How can I resolve this?

Link to my site: http://www.bleachstory.net/



Last edited by udarsha45 on October 26th 2016, 6:43 am; edited 1 time in total
udarsha45
udarsha45
Forumember

Male Posts : 626
Reputation : 9
Language : English
Location : Sri Lanka

http://bleach.5forum.net

Back to top Go down

Solved Re: Load more topics query problem!

Post by Ch@lo Valdez October 26th 2016, 1:38 am

try

Code:

$(function () {
    if ($('a[onmousedown^="createPagination"]').length != -1) {
        $('head').append('<style type="text/css"> #more_topics { text-align: center; font-weight: bold; } #more_topics a { display: block; padding: 10px 0; } #content_loaded { border-top: 2px solid #ddd; } </style>');
        $('.paged-foot').append('<div id="more_topics"> <a href="#" id="load_more">Load more topics</a></div>');
        $('.paging:first > b').next().addClass('load');
        $('#load_more').click(function (c) {
            c.preventDefault();
            $.get($('.load').attr('href'), function (d) {
                var a = $('.topic_list:last', d).children('tbody').html();
                if (a && $('.load').length) {
                    $('.topic_list:last').children('tbody').append(a);

                    $('.load').removeClass('load').next('a:not(:has(img))').addClass('load');
                } else {
                    alert("No more topics to be loaded");
                }
            });
        });
    }
});
Ch@lo Valdez
Ch@lo Valdez
Forumember

Male Posts : 138
Reputation : 50
Language : spanish

Back to top Go down

Solved Re: Load more topics query problem!

Post by udarsha45 October 26th 2016, 4:41 am

@Ch@lo Valdez It's working.

Btw, is their a way to add a thing like this; https://media.giphy.com/media/RkfTV5dv6bT56/giphy.gif

By this I mean the rotating arrow in a circle.

Anyway to add it?

udarsha45
udarsha45
Forumember

Male Posts : 626
Reputation : 9
Language : English
Location : Sri Lanka

http://bleach.5forum.net

Back to top Go down

Solved Re: Load more topics query problem!

Post by Ch@lo Valdez October 26th 2016, 5:27 am

try this
Code:

$(function () {
    var img = 'https://i97.servimg.com/u/f97/17/46/52/67/ajax-l11.gif';
    if ($('a[onmousedown^="createPagination"]').length != -1) {
        $('head').append('<style type="text/css"> #more_topics { text-align: center; font-weight: bold; } #more_topics a { display: block; padding: 10px 0; } #content_loaded { border-top: 2px solid #ddd; } </style>');
        $('.paged-foot').append('<div id="more_topics"><a href="#" id="load_more"><img src="'+img+'"> Load more topics</a></div>');
        $('.paging:first > b').next().addClass('load');
        $('#load_more').click(function (c) {
            c.preventDefault();
            $.get($('.load').attr('href'), function (d) {
                var a = $('.topic_list:last', d).children('tbody').html();
                if (a && $('.load').length) {
                    $('.topic_list:last').children('tbody').append(a);

                    $('.load').removeClass('load').next('a:not(:has(img))').addClass('load');
                } else {
                    alert("No more topics to be loaded");
                }
            });
        });
    }
});

change the img link here:
Code:
var img = 'https://i97.servimg.com/u/f97/17/46/52/67/ajax-l11.gif';
Ch@lo Valdez
Ch@lo Valdez
Forumember

Male Posts : 138
Reputation : 50
Language : spanish

Back to top Go down

Solved Re: Load more topics query problem!

Post by udarsha45 October 26th 2016, 6:42 am

Thanks alot!
udarsha45
udarsha45
Forumember

Male Posts : 626
Reputation : 9
Language : English
Location : Sri Lanka

http://bleach.5forum.net

Back to top Go down

Solved Re: Load more topics query problem!

Post by Ape October 26th 2016, 7:35 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


Load more topics query problem! Left1212Load more topics query problem! Center11Load more topics query problem! Right112
Load more topics query problem! Ape_b110
Load more topics query problem! Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19075
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum