diff --git a/src/js/pannellum.js b/src/js/pannellum.js index ead7333..8dd96bb 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -1869,6 +1869,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);