Created
September 18, 2023 17:19
-
-
Save eagles038/0bd23e32999f7c96118a391132d93d6b to your computer and use it in GitHub Desktop.
Постраничная навигация для нескольких табов
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // постраничная навигация | |
| $(document).on('click', '.load-more-items', function(){ | |
| let navPar = '#'+$(this).parent().parent().attr('id'); | |
| var targetContainer = $(navPar+' .items-list'), | |
| url = $(navPar+' .load-more-items').attr('data-url'); | |
| if (url !== undefined) { | |
| $.ajax({ | |
| type: 'GET', | |
| url: url, | |
| dataType: 'html', | |
| success: function(data){ | |
| $(navPar+' .load-more-items').remove(); | |
| var elements = $(data).find(navPar+' .item-content'), | |
| pagination = $(data).find(navPar+' .load-more-items'); | |
| targetContainer.append(elements); | |
| $(navPar+' #pag').append(pagination); | |
| } | |
| }); | |
| } | |
| }); | |
| // постраничная навигация |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment