Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function(){
- const originalFetch = window.fetch;
- window.fetch = function(url, options) {
- return originalFetch(url, options)
- .finally(() => {
- setTimeout(() => {
- // проверяем все блоки
- document.querySelectorAll('.cont-block-hide').forEach(container => {
- const btn = container.querySelector('.coll-btn-hide');
- const btnContainer = container.querySelector('.coll-pag-hide');
- if (btn && btnContainer && !btn.getAttribute('href')) {
- btnContainer.style.display = 'none';
- }
- });
- }, 100);
- });
- };
- $('.cont-block-hide').each(function () {
- const $container = $(this);
- const $items = $container.find('.coll-item-hide');
- // если нет элементов — скрываем блок
- if (!$items.length) {
- $container.hide();
- }
- // проверяем кнопку внутри этого конкретного контейнера
- const btn = $container.find('.coll-btn-hide')[0];
- const btnContainer = $container.find('.coll-pag-hide')[0];
- if (btn && btnContainer && !btn.getAttribute('href')) {
- btnContainer.style.display = 'none';
- }
- });
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment