Sfoglia il codice sorgente

Customizable attributes for Hotspots

Sometimes more than just the target attribute needs to be customized on the hotspot. Expansion of ba35ea8

Hotspots now accept an object with a list of attributes to append to the anchor tag.
pull/663/head
DLar 6 anni fa
committed by Matthew Petroff
parent
commit
f07910d3b6
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. +7
    -1
      src/js/pannellum.js

+ 7
- 1
src/js/pannellum.js Vedi File

@@ -1708,7 +1708,13 @@ function createHotSpot(hs) {
} else if (hs.URL) {
a = document.createElement('a');
a.href = sanitizeURL(hs.URL);
a.target = hs.target ? hs.target : '_blank';
if (hs.attributes) {
for (var key in hs.attributes) {
a.setAttribute(key, hs.attributes[key]);
}
} else {
a.target = '_blank';
}
renderContainer.appendChild(a);
div.className += ' pnlm-pointer';
span.className += ' pnlm-pointer';


Caricamento…
Annulla
Salva