Uname:
Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software:
Apache
PHP version:
8.0.30 [ PHP INFO ] PHP os:
Linux
Server Ip:
145.239.37.162
Your Ip:
216.73.216.190
User:
dreampi (1009562) | Group:
users (100)
Safe Mode:
OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl
(function ($) {
"use strict";
$(window).on('elementor/frontend/init', function () {
elementorFrontend.hooks.addAction('frontend/element_ready/motiox-all-project.default', function ($element) {
let addHandler = $('.motiox-swiper-wrapper', $element);
if (addHandler.length > 0) {
elementorFrontend.elementsHandler.addHandler(motioxSwiperBase, {
$element,
});
}
$('#elementor-load-more-button').on('click', function () {
const button = $(this);
const spinner = button.find('.motiox-icon-spinner-01');
const arrow = button.find('.motiox-icon-arrow-right-m');
const pagination = $('.pagination');
const container = $('.elementor-all-project-wrapper .motiox-con-inner');
if (button.hasClass('loading')) {
return;
}
button.addClass('loading');
arrow.hide();
spinner.show();
const currentPage = parseInt(button.data('current-page'));
const maxPages = parseInt(button.data('max-pages'));
if (currentPage < maxPages) {
const nextPage = currentPage + 1;
button.data('current-page', nextPage);
$.ajax({
url: window.location.href,
data: {
paged: nextPage
},
type: 'GET',
success: function (response) {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = response;
const $newWrapper = $(tempDiv).find('.elementor-all-project-wrapper .motiox-con-inner');
if ($newWrapper.length > 0) {
const newItems = $newWrapper.children('.elementor-all-project-item');
if (newItems.length > 0) {
container.append(newItems);
if (nextPage >= maxPages) {
button.fadeOut();
pagination.css('margin-top', '0');
}
} else {
button.fadeOut();
pagination.css('margin-top', '0');
}
} else {
button.fadeOut();
pagination.css('margin-top', '0');
}
},
error: function (xhr, status, error) {
console.error("Error AJAX:", status, error);
},
complete: function () {
button.removeClass('loading');
spinner.hide();
arrow.show();
}
});
} else {
button.fadeOut();
pagination.css('margin-top', '0');
}
});
});
});
})(jQuery);