瀏覽代碼

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 年之前
committed by Matthew Petroff
父節點
當前提交
f07910d3b6
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. +7
    -1
      src/js/pannellum.js

+ 7
- 1
src/js/pannellum.js 查看文件

@@ -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';


Loading…
取消
儲存