help in executing js function on hotspot click for newbie...

  • Hi all,

    I have a single panorama and want to show a popup page when user clicks on certain area.
    I added a hotspot and edited xml to call a js function on page but nothing happens!?!
    What am I doing wrong?

    my XML:
    <hotspot name="spot1" style="skin_hotspotstyle" onclick="js( test() );" ath="53.284" atv="2.329" />

    my javascript:
    function test()
    {
    alert("function called!");
    }

    any help would be appreciated!!!

  • well I found a workaround that works for me, so I will share...

    I added a polygonal hotspot and linked it to JS function successfully!

    and here is the code:

    hotspot in XML file:
    <hotspot name="gotolivingroom" onclick="js(test(123));">
    <point ath="-93.7" atv="-8.9" />
    <point ath="-83.4" atv="-15.3" />
    <point ath="-77.1" atv="-10.9" />
    <point ath="-62.1" atv="8.8" />
    <point ath="-60.4" atv="37.1" />
    <point ath="-82.2" atv="47.3" />
    <point ath="-92.8" atv="35.4" />
    </hotspot>

    and JS function in html file:
    function test(x)
    {
    //alert("function called with"+x+"!");
    newwindow=window.open('http://www.google.com','name','height=600,width=800');
    }

    hope I helped someone...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!