From 15ef86b19d5aa3b7784bac2625f1cf6d00ffc44f Mon Sep 17 00:00:00 2001 From: Wolfshe <120183918+Wolfshe@users.noreply.github.com> Date: Fri, 9 Dec 2022 13:55:59 +0100 Subject: [PATCH] Add files via upload --- src/js/pannellum.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/js/pannellum.js b/src/js/pannellum.js index 950f6cb..8abac4b 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -1863,6 +1863,23 @@ function createHotSpot(hs) { else div.className += ' pnlm-hotspot pnlm-sprite pnlm-' + escapeHTML(hs.type); + if ( 'thumbnail' in hs ) { + let thumbnail = hs.thumbnail; + div.addEventListener("mouseenter",function(){ + div.style.backgroundImage = `url(${thumbnail})`; + div.style.border = "solid"; + div.style.backgroundPosition = "center"; + div.style.backgroundSize = "contain"; + }) + + div.addEventListener("mouseleave",function(){ + div.style.backgroundImage = ""; + div.style.border = ""; + div.style.backgroundPosition = ""; + div.style.backgroundSize = ""; + }) + } + var span = document.createElement('span'); if (hs.text) span.innerHTML = escapeHTML(hs.text);