ZwiiCMS/core/vendor/tippy/init.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-04-02 08:29:19 +02:00
/**
* Initialisation de Tippy
*/
2022-01-21 10:58:13 +01:00
$(document).ready(function () {
// Tooltip des attributs title
tippy("[data-tippy-content]", {
arrow: true,
placement: "top"
});
// Pour les images map, pas de flèche, bulle haut suivant le curseur
tippy('img[title], a[title]:not(.button), area[title]', {
content(reference) {
const title = reference.getAttribute('title')
reference.removeAttribute('title')
return title
},
placement: "top",
followCursor: true,
animation: "fade",
animateFill: true
});
// Tooltip des aides
tippy('a.button[title]', {
content(reference) {
const title = reference.getAttribute('title')
reference.removeAttribute('title')
return title
},
delay: [1000,250],
placement: "bottom",
followCursor: false,
arrow: true,
animateFill: true,
arrowType: "round",
});
// Pour les images map, pas de flèche, bulle haut suivant le curseur
tippy("#image-map", {
placement: "top",
followCursor: true,
animation: "fade",
animateFill: true
});
});