You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
On touchscreen devices, tooltip now disappears on scroll or after 10 seconds
This commit is contained in:
@@ -908,6 +908,11 @@ function initTooltips() {
|
|||||||
posX -= tooltipWidth / 2;
|
posX -= tooltipWidth / 2;
|
||||||
posY -= tooltipHeight + 10;
|
posY -= tooltipHeight + 10;
|
||||||
tooltip.css({ top: posY, left: posX, opacity: 1 }); // Set opacity to 1
|
tooltip.css({ top: posY, left: posX, opacity: 1 }); // Set opacity to 1
|
||||||
|
// For touchscreen devices
|
||||||
|
if ((/Mobi|Android|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)) && ('ontouchstart' in window || navigator.maxTouchPoints)) {
|
||||||
|
setTimeout(() => { $('.tooltiptext').remove(); }, 10000);
|
||||||
|
document.addEventListener('touchstart', function() { setTimeout(() => { $('.tooltiptext').remove(); }, 500); });
|
||||||
|
}
|
||||||
}, 500));
|
}, 500));
|
||||||
}, function() {
|
}, function() {
|
||||||
// Clear the timeout if the mouse leaves before the delay completes
|
// Clear the timeout if the mouse leaves before the delay completes
|
||||||
|
|||||||
Reference in New Issue
Block a user