Jump to content

Featured Replies

Posted
comment_198933

How can I use infinite scroll instead of paging?
What code should I add to the template? @Desti @Exception 

https://invisioncommunity.com/4guides/themes-and-customizations/javascript-framework/using-ui-widgets/ipsuiinfinitescroll-r47/

 

128.jpg

comment_198934
29 минут назад, afshin20 сказал:

How can I use infinite scroll instead of paging?
What code should I add to the template?

Обратиться к кодеру на платной основе

  • 2 недели спустя...
  • 3 недели спустя...
  • Author
comment_199974
On 1/20/2024 at 10:36 AM, Exception said:

Обратиться к кодеру на платной основе

Can you tell me where the changes in the template should be made so that this infinite scroll is displayed?

comment_200076
7 minutes ago, afshin20 said:

Can you advise which parts should be changed?

Я также очень хочу сделать это на своем веб-сайте. Пожалуйста, может кто-нибудь помочь с советом?

  • Author
comment_200106
On 1/20/2024 at 10:05 AM, afshin20 said:

How can I use infinite scroll instead of paging?
What code should I add to the template? @Desti @Exception 

https://invisioncommunity.com/4guides/themes-and-customizations/javascript-framework/using-ui-widgets/ipsuiinfinitescroll-r47/

 

128.jpg

 

bruce-lee-kick.gif

  • Author
comment_200128
  {{if $pages > 1}}
    <script>
        $(window).on('scroll', function() {
            if ($(window).scrollTop() + $(window).height() >= $(document).height()) {
                loadMoreItems();
            }
        });

        function loadMoreItems() {
            var currentPage = parseInt('{$page}' || '1');
            var nextPage = currentPage + 1;
            if (nextPage <= {$pages}) {
                var url = '{$baseUrl->setPage($pageParam, "' + nextPage + '")}';
                $.ajax({
                     url: '/files?page=' + nextPage,
                    type: 'GET',
                    success: function(response) {
                        var items = $(response).find('.item');
                        $('#itemList').append(items);
                    },
                    error: function() {
                          // Error message if needed                    }
                });
            }
        }
    </script>
{{endif}}

@Exception @Desti This code was in the stackoverflow website, can you tell me how I can do this?

Please, I need it.

comment_200132
1 час назад, afshin20 сказал:
  {{if $pages > 1}}
    <script>
        $(window).on('scroll', function() {
            if ($(window).scrollTop() + $(window).height() >= $(document).height()) {
                loadMoreItems();
            }
        });

        function loadMoreItems() {
            var currentPage = parseInt('{$page}' || '1');
            var nextPage = currentPage + 1;
            if (nextPage <= {$pages}) {
                var url = '{$baseUrl->setPage($pageParam, "' + nextPage + '")}';
                $.ajax({
                     url: '/files?page=' + nextPage,
                    type: 'GET',
                    success: function(response) {
                        var items = $(response).find('.item');
                        $('#itemList').append(items);
                    },
                    error: function() {
                          // Error message if needed                    }
                });
            }
        }
    </script>
{{endif}}

@Exception @Desti This code was in the stackoverflow website, can you tell me how I can do this?

Please, I need it.

Я не занимаюсь благотворительностью и не пишу код за спасибо.

ips.ui.infinitescroll подойдет для решения задачи

  • Author
comment_200133
2 minutes ago, Exception said:

ips.ui.infinitescroll подойдет для решения задачи

I just want to know, is it possible to do this with javascript code without a plugin?

comment_200134
23 минуты назад, afshin20 сказал:

I just want to know, is it possible to do this with javascript code without a plugin?

Думаю да, для ipsInfScroll можно использовать примерно те же параметры что и в ipsPagination

  • Author
comment_200139

Can you tell me what data I should write for these cases? I don't know exactly what to write? @Desti @Exception
scrollScope, container, url, pageParam

<script>
ips.ui.infinitescroll({
  scrollScope: 'body',
  container: '#content',
  distance: 50,
  url: '{$subcategory->url()}',
  pageParam: 'page',
  loadingTpl: 'core.infScroll.loading',
  pageBreakTpl: 'core.infScroll.pageBreak',
  disableIn: 'phone,tablet,desktop'
});
</script>

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.


Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.