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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-tooltip-1.0.js

Код файла
Версия от 18.08.2026, 07:00:16 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
301									var instance = tooltipstered[arrId[j]];302									var status = instance.status();303									var autoClose = instance.option('autoClose');304 305									if (status !== 'hidden' && status !== 'disappearing' && autoClose) {306										instance.hide();307									}308								}309							}310						}311					}312 
История файла и сравнение версий
  • 18.08.2026, 07:00:16 · 56c3b845
313
/**
314 * Calls custom functions after shown
315 */
316 function finish() {
317 self.Status = 'shown';
318
319 // trigger any show method custom callbacks and reset them
320 for (var i = 0; i < self.callbacks.show.length; i++) {
321 self.callbacks.show[i].call(self.element);
322 }
323
324 self.callbacks.show = [];
325 }
326
327 // if this origin already has its tooltip open
328 if (self.Status !== 'hidden') {
329 // the timer (if any) will start (or restart) right now
330 var extraTime = 0;
331 // if it was disappearing, cancel that
332 if (self.Status === 'disappearing') {
333 self.Status = 'appearing';
334
335 if (supportsTransitions()) {
336 t_removeClass(self.tooltip, 'tooltipster-dying');
337 t_addClass(self.tooltip, 'tooltipster-' + self.options.animation + '-show');
338
339 self.tooltip.addEventListener('animationend', function () {
340 finish();
341 });
342 } else {
343 // in case the tooltip was currently fading out, bring it back to life
344 t_fadeIn(self.tooltip, self.options.speed, finish);
345 }
346 } else if (self.Status === 'shown') {
347 // if the tooltip is already open, we still need to trigger the method custom callback
348 finish();
349 }
350 } else {
351 // if the tooltip isn't already open, open that sucker up!
352 self.Status = 'appearing';
353
354 // the timer (if any) will start when the tooltip has fully appeared after its transition
355 var extraTime = self.options.speed;
356
357 // disable horizontal scrollbar to keep overflowing tooltips from jacking with it and then restore it to its previous value
358 self.bodyOverflowX = getComputedStyle(body, null).overflowX;
359 body.style.overflowX = 'hidden';
360
361 // get some other settings related to building the tooltip
362 var animation = 'tooltipster-' + self.options.animation;
363 // prettier-ignore
364 var animationSpeed =
365 '-webkit-transition-duration: ' + self.options.speed + 'ms;' +
366 '-webkit-animation-duration: ' + self.options.speed + 'ms;' +
367 '-moz-transition-duration: ' + self.options.speed + 'ms;' +
368 '-moz-animation-duration: ' + self.options.speed + 'ms;' +
369 '-o-transition-duration: ' + self.options.speed + 'ms;' +
370 '-o-animation-duration: ' + self.options.speed + 'ms;' +
371 '-ms-transition-duration: ' + self.options.speed + 'ms;' +
372 '-ms-animation-duration: ' + self.options.speed + 'ms;' +
373 'transition-duration: ' + self.options.speed + 'ms;' +
374 'animation-duration: ' + self.options.speed + 'ms;';
375
376 var minWidth = self.options.minWidth
377 ? 'min-width:' + Math.round(self.options.minWidth) + 'px;'
378 : '';
379 var maxWidth = self.options.maxWidth
380 ? 'max-width:' + Math.round(self.options.maxWidth) + 'px;'
381 : '';
382 var pointerEvents = self.options.interactive ? 'pointer-events: auto;' : '';
383
384 // build the base of our tooltip
385 var div = document.createElement('div');
386
387 div.role = 'tooltip';
388
389 t_addClass(div, 'tooltipster-base ' + self.options.theme);
390 div.style = minWidth + ' ' + maxWidth + ' ' + pointerEvents + ' ' + animationSpeed;
391 div.innerHTML = '<div class="tooltipster-content"></div>';
392
393 self.tooltip = div;
394
395 // only add the animation class if the user has a browser that supports animations
396 if (supportsTransitions()) t_addClass(self.tooltip, animation);
397
398 // insert the content
399 self._content_insert();
400
Предыдущие 100 строкСледующие 100 строк