• Hello,

    I am trying to use openurl() to open a URL from an onclick event on a hotspot.

    I have tried a thousand ways to get this working and it's driving me loopy. Please can someone tell me what I am doing wrong? Here is my hotspot code from the XML file.

    <hotspot name="spot1" style="skin_hotspotstyle" ath="-8.183" atv="2.442" onclick="openurl('http://krpano.com',_self)" />
    also
    <hotspot name="spot1" style="skin_hotspotstyle" ath="-8.183"
    atv="2.442" onclick="openurl('http://krpano.com',_self);" />
    and a squillion variations thereof.

    The hotspot displays, but clicking on yields no response.

    Gnash.
    in hope,
    Claire

  • OK, I figured this out. Phew.

    The XML generated by the default krpano droplet includes a file skin/vtourskin.xml, which contains an onclick event for the style skin_hotspotstyle. This overwrites the onclick event.

    I therefore added a linkedurl attribute in the same style as linkedscene to this onclick event, and it all works fine.

    i.e.

    Code
    if(linkedurl, openurl(get(linkedurl),_self);)
  • Hi

    I am struggling with the same problem. I have tried many variations of this but nothing happens on click. I created my own style. The image appears so the style is located

    Any suggestions welcome

    in tour.xml
    <hotspot name="spot1" style="youTubeStyle" ath="55.794" atv="-14.871" linkedurl="

    >


    in vtourskin.xml

    <style name="youTubeStyle" url="vtourskin_hotspot_r.png" scale="0.5" edge="top" oy="0" distorted="false"
    tooltip=""
    onclick= "if(linkedurl, openurl(get(linkedurl),_blank);)"
    />

  • Klaus

    Thanks. Testing locally was the problem. now solved. Thanks

    There is some discussion in the forums about embedding youTube videos in Krpano. Is there any way of doing this without custom js?

    Thanks

  • if(linkedurl, openurl(get(linkedurl),_self);)

    OK, I figured this out. Phew.

    The XML generated by the default krpano droplet includes a file skin/vtourskin.xml, which contains an onclick event for the style skin_hotspotstyle. This overwrites the onclick event.

    I therefore added a linkedurl attribute in the same style as linkedscene to this onclick event, and it all works fine.

    i.e.

    Code
    if(linkedurl, openurl(get(linkedurl),_self);)

    Can you please show a screenshot of the code because i can't figure it out..
    Thx

Jetzt mitmachen!

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