Igor150195

скрытие

Oct 29th, 2025 (edited)
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <script>
  2. (function(){
  3. const originalFetch = window.fetch;
  4.  
  5. window.fetch = function(url, options) {
  6. return originalFetch(url, options)
  7. .finally(() => {
  8. setTimeout(() => {
  9. // проверяем все блоки
  10. document.querySelectorAll('.cont-block-hide').forEach(container => {
  11. const btn = container.querySelector('.coll-btn-hide');
  12. const btnContainer = container.querySelector('.coll-pag-hide');
  13.  
  14. if (btn && btnContainer && !btn.getAttribute('href')) {
  15. btnContainer.style.display = 'none';
  16. }
  17. });
  18. }, 100);
  19. });
  20. };
  21.  
  22. $('.cont-block-hide').each(function () {
  23. const $container = $(this);
  24. const $items = $container.find('.coll-item-hide');
  25.  
  26. // если нет элементов — скрываем блок
  27. if (!$items.length) {
  28. $container.hide();
  29. }
  30.  
  31. // проверяем кнопку внутри этого конкретного контейнера
  32. const btn = $container.find('.coll-btn-hide')[0];
  33. const btnContainer = $container.find('.coll-pag-hide')[0];
  34.  
  35. if (btn && btnContainer && !btn.getAttribute('href')) {
  36. btnContainer.style.display = 'none';
  37. }
  38. });
  39. })();
  40. </script>
Advertisement
Add Comment
Please, Sign In to add comment