Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-scripts-3.0.js

Код файла
Версия от 29.09.2026, 07:00:43 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
601			min = parseInt(min);602 603			if (min <= max) {604				if (windowWidth <= max && windowWidth > min) {605					if (display !== 'block') {606						rec.style.display = 'block';607					}608				} else if (display !== 'none') {609					rec.style.display = 'none';610				}611			}612		}613
История файла и сравнение версий
  • 29.09.2026, 07:00:43 · 56c3b845
}
614
615 t_onReady(function () {
616 t_setWindowVars();
617 t_blocksdisplay();
618
619 window.addEventListener(
620 'resize',
621 t_throttle(function () {
622 t_setWindowVars();
623 }, 200)
624 );
625 window.addEventListener(
626 'resize',
627 t_throttle(function () {
628 t_blocksdisplay();
629 }, 200)
630 );
631 });
632})();
633
634/**
635 * Defining heights for covers and other blocks in the mobile version,
636 * reducing fonts and tracking blocks that are not optimized for the mobile version
637 */
638(function () {
639 var isInstagram = navigator.userAgent.indexOf('Instagram') !== -1;
640 function t_correctHeight() {
641 var coverCarries = document.querySelectorAll('.t-cover__carrier');
642 var factor = 0;
643
644 for (var i = 0; i < coverCarries.length; i++) {
645 var element = coverCarries[i];
646 var elementStyle = element.style;
647
648 if (elementStyle.height.indexOf('vh') > -1) {
649 factor = parseInt(elementStyle.height, 10) / 100;
650
651 var div = document.createElement('div');
652 div.id = 'tempDiv';
653 div.style.cssText = 'position:absolute;top:0;left:0;width:100%;height:100vh;visibility:hidden;';
654 document.body.appendChild(div);
655
656 var tempDiv = document.getElementById('tempDiv');
657 var tempDivHeight = parseInt(getComputedStyle(tempDiv).height.replace('px', ''));
658 t_removeEl(tempDiv);
659
660 var newHeight = Math.round(tempDivHeight * factor) + 'px';
661 var cover = element.closest('.t-cover');
662
663 if (cover) {
664 var coverFilter = cover.querySelector('.t-cover__filter');
665 var textBox = cover.querySelector('.t-cover__wrapper');
666
667 cover.style.height = newHeight;
668
669 if (coverFilter) coverFilter.style.height = newHeight;
670 if (textBox) textBox.style.height = newHeight;
671 }
672
673 elementStyle.height = newHeight;
674 }
675 }
676
677 // others
678 var elCarries = document.querySelectorAll('[data-height-correct-vh]');
679 var windowHeight = window.innerHeight;
680 factor = 0;
681
682 for (var i = 0; i < elCarries.length; i++) {
683 var element = elCarries[i];
684 var elementStyle = element.style;
685
686 if (elementStyle.height.indexOf('vh') > -1) {
687 factor = parseInt(elementStyle.height) / 100;
688 newHeight = windowHeight * (isNaN(factor) ? 1 : factor) + 'px';
689 elementStyle.height = newHeight;
690 }
691 }
692 }
693
694 if (window.isMobile || window.parent.isPagePreview) {
695 t_onReady(function () {
696 setTimeout(t_correctHeight, 400);
697 });
698
699 window.addEventListener('load', function () {
700 setTimeout(t_correctHeight, 400);
Предыдущие 100 строкСледующие 100 строк