The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Load more topics query problem!

Go down

Solved Load more topics query problem!

Post by udarsha45 on 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
avatar
udarsha45
Forumember

Male Posts : 567
Reputation : 6
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 on 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");
                }
            });
        });
    }
});
avatar
Ch@lo Valdez
Forumember

Male Posts : 131
Reputation : 46
Language : spanish

Back to top Go down

Solved Re: Load more topics query problem!

Post by udarsha45 on 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?

avatar
udarsha45
Forumember

Male Posts : 567
Reputation : 6
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 on 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';
avatar
Ch@lo Valdez
Forumember

Male Posts : 131
Reputation : 46
Language : spanish

Back to top Go down

Solved Re: Load more topics query problem!

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

Thanks alot!
avatar
udarsha45
Forumember

Male Posts : 567
Reputation : 6
Language : English
Location : Sri Lanka

http://bleach.5forum.net

Back to top Go down

Solved Re: Load more topics query problem!

Post by APE on October 26th 2016, 7:35 pm

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



avatar
APE
Manager
Manager

Male Posts : 11637
Reputation : 1134
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

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

Back to top Go down

Back to top


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