Browse Source

Add functionality to execute javascript functions when clicking or touching on hotspots

pull/260/head
Dieter Meiller 8 years ago
parent
commit
0ca7677033
1 changed files with 16 additions and 0 deletions
  1. +16
    -0
      src/js/pannellum.js

+ 16
- 0
src/js/pannellum.js View File

@@ -1593,6 +1593,22 @@ function createHotSpot(hs) {
div.style.cursor = 'pointer'; div.style.cursor = 'pointer';
span.style.cursor = 'pointer'; span.style.cursor = 'pointer';
a.appendChild(div); a.appendChild(div);
} else if (hs.action) {
a = document.createElement('a');
a.href = "#";
a.ontouchstart = function() {
this.touchAvailable = true;
hs.action();
};
a.onclick = function() {
if (!this.touchAvailable) {
hs.action();
}
};
renderContainer.appendChild(a);
div.style.cursor = 'pointer';
span.style.cursor = 'pointer';
a.appendChild(div);
} else { } else {
if (hs.sceneId) { if (hs.sceneId) {
div.onclick = function() { div.onclick = function() {


Loading…
Cancel
Save