Accessing Hotspot from Javascript

  • Hello,

    I have 3 question related to hotspots behaviour.

    1. How can I enumerate the names of all hotspots to be used in Javascript.

    2. How can I modify a property of a hotspot (eg. alpha) from Javascript and also how can I read it.


    Many thanks for your help,

  • first make sure krpano is loaded, then

    Code
    var krpano = document.getElementById('krpanoSWFObject');
    var hotspot_count = krpano.get('hotspot.count');
    for(i = 0; i < hotspot_count; i++){
          console.log(krpano.get('hotspot[ ' + i + '].name'));
          krpano.set('hotspot[' + i + '].alpha', 0.5);
    }

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!