You are not logged in.

> The forum rules have been updated. Please take a moment to read them.


#1 2012-12-06 11:51:59

Chromo56
Member
From: the Netherlands
Registered: 2012-11-24
Posts: 11
Website

javascript hotspot

Hello,

I hope anyone can help me out. I'm strugeling for serveral days to get this to work.
I want to call a javascript function declerated in the index.html file, like this example below:
...
<body>
  [[Virtualtour code]]
<script>
  function callToAction(pid){
    alert(pid);
  }
</script>
</body>
...
I want the pano tour to call the function 'callToAction' supplying the function with a variable. In the program I made a hotspot, for the link I'm using the javascript option and filled in: "m callToAction(hello world)". When I test the tour nothing is happening.
To prove the function working I also made a normal link in HTML (<a href="javascript:callToAction('hello world');void(0);">Test function</a>) to trigger the function 'manually', this works perfectly.
How can I get this to work via the tour?

Thanks


Uploaded Images

Offline

 

#2 2012-12-07 08:33:03

Destiny
Moderator
From: Australia
Registered: 2010-04-27
Posts: 2358
Website

Re: javascript hotspot

Hi.. looking at your javascript you are not telling it do do anything.

Have you tried.. onClick=callToAction(hello world)

Destiny..


Virtual Tours and 3D/360 Object/Product Photographer - Our aim is to create a 3D/360 Virtual Tour Shop/Store with links to 3D/360 degree products. My gear, VR Drive II - D90 - Nikon 10.5 fisheye - Nikon D800 with Nikon-Nikkor 14-24 - NOVOFLEX Magic Balance - Acratech GP Ball-head - Nodal Ninja 4 + RD-16 Rotor - Manfrotto 190CXPRO4 Carbon Fiber Tripod smile smile

Offline

 

#3 2012-12-07 10:03:56

bdd
Administrator
Registered: 2011-01-18
Posts: 622
Website

Re: javascript hotspot

Hi,

The way you wrote your call in the Hotspot Properties is the right one.
To be able to call some JS function you have to enable the JS interface of the player. In the current version of Panotour Pro, it is not enabled by default (it will be in 2.0 version).
To enable the JS interface, you have to use the domains restriction feature in the "Project Properties/Build" tab.

Best Regards,
Gérald

Offline

 

#4 2012-12-07 10:23:25

Destiny
Moderator
From: Australia
Registered: 2010-04-27
Posts: 2358
Website

Re: javascript hotspot

May I ask, what will you use this for.. I just uploaded a test... http://members.westnet.com.au/dps/js/co … ltour.html

Destiny...


Virtual Tours and 3D/360 Object/Product Photographer - Our aim is to create a 3D/360 Virtual Tour Shop/Store with links to 3D/360 degree products. My gear, VR Drive II - D90 - Nikon 10.5 fisheye - Nikon D800 with Nikon-Nikkor 14-24 - NOVOFLEX Magic Balance - Acratech GP Ball-head - Nodal Ninja 4 + RD-16 Rotor - Manfrotto 190CXPRO4 Carbon Fiber Tripod smile smile

Offline

 

#5 2012-12-07 11:48:22

Chromo56
Member
From: the Netherlands
Registered: 2012-11-24
Posts: 11
Website

Re: javascript hotspot

Hi Destiny,

It works. I seemed to have had a problem with Wamp. I couldn't get scripts to work.
I like Panotour and like to exlpore the crative possibilities.
Have a look at: www.panoramix360.nl then you see what I mean.

Thanks

René

Offline

 

#6 2012-12-07 12:03:47

Destiny
Moderator
From: Australia
Registered: 2010-04-27
Posts: 2358
Website

Re: javascript hotspot

Thats good.. wink I guess that was what Gérald was suggesting...

Really cool link... I love ptp for its endless possibilities too.. I never get tried of trying new things.. I tend to bounce from one thing to other... but often forget how I did it.. lol

I am sooo looking forward to checking out V2.. I am really holding off from getting too involved with some of the ideas I have until I check the new version out.. The real power of ptp is the editing of the code/script options... I love seeing what others are achiveving, it tends to give me ideas.. big_smile

Destiny....


Virtual Tours and 3D/360 Object/Product Photographer - Our aim is to create a 3D/360 Virtual Tour Shop/Store with links to 3D/360 degree products. My gear, VR Drive II - D90 - Nikon 10.5 fisheye - Nikon D800 with Nikon-Nikkor 14-24 - NOVOFLEX Magic Balance - Acratech GP Ball-head - Nodal Ninja 4 + RD-16 Rotor - Manfrotto 190CXPRO4 Carbon Fiber Tripod smile smile

Offline

 

#7 2012-12-08 08:17:12

Destiny
Moderator
From: Australia
Registered: 2010-04-27
Posts: 2358
Website

Re: javascript hotspot

René, by rights the script should not need onclick since that is in the xml code for the hotspot.. However, i have had issues with not putting onclick, it doesn't seem to work.. For the scripts I have had working, if I put onclick with the call in ptp, it works.. but without it, it doesn't..

<hotspot name="spot0" onclick="onclick=js(return hs.expand(id=thumb2));"

... but in saying that.. this call doesn't work yet... lol ... Now I am working with the notion of not putting the onclick to see if I can get it to work... rollroll

Destiny...


Virtual Tours and 3D/360 Object/Product Photographer - Our aim is to create a 3D/360 Virtual Tour Shop/Store with links to 3D/360 degree products. My gear, VR Drive II - D90 - Nikon 10.5 fisheye - Nikon D800 with Nikon-Nikkor 14-24 - NOVOFLEX Magic Balance - Acratech GP Ball-head - Nodal Ninja 4 + RD-16 Rotor - Manfrotto 190CXPRO4 Carbon Fiber Tripod smile smile

Offline

 

#8 2012-12-08 12:18:26

Chromo56
Member
From: the Netherlands
Registered: 2012-11-24
Posts: 11
Website

Re: javascript hotspot

I will hand this information to my son who is the expert. My knowledge on this subject ends with html.
We'll post our results because it is important to have links from the photography we produce to the customers collection.
If you look at the fashion shoots on my website you can see it's potential.
It might take a little time because we leave for Australia next thursday. A little luxury problem.

René

Offline

 

#9 2012-12-08 12:36:11

Destiny
Moderator
From: Australia
Registered: 2010-04-27
Posts: 2358
Website

Re: javascript hotspot

lol Bring your sun cream, it was 39c in Queensland last week.. cool or bring your brolly, the stroms are coming now... roll

I will continue to play with the JavaScript, its a pain.. Not even sure if what I am trying to do is doable...

Have fun in the land down-under..

Destiny...


Virtual Tours and 3D/360 Object/Product Photographer - Our aim is to create a 3D/360 Virtual Tour Shop/Store with links to 3D/360 degree products. My gear, VR Drive II - D90 - Nikon 10.5 fisheye - Nikon D800 with Nikon-Nikkor 14-24 - NOVOFLEX Magic Balance - Acratech GP Ball-head - Nodal Ninja 4 + RD-16 Rotor - Manfrotto 190CXPRO4 Carbon Fiber Tripod smile smile

Offline

 

#10 2012-12-19 08:08:15

Beru
New member
Registered: 2012-12-19
Posts: 2

Re: javascript hotspot

Hi Guys,
Allright so here is my situation:

I have a panotour VT embed into a html page with hotspots that are to display content of another html page in a shadowbox.
This example is what im trying to achieve

http://virtualtuur.com/shadowboxtest/

I have this javascript function on the page where the VT is embed :

<script type="text/javascript">
function openShadowbox(content, title){
    Shadowbox.open({
        content:    content,
        title:      title
    });
}
</script>

How do I call my function in Hotspot properties in panotour?

Ive tried like : openShadowbox(toppano/page1.html, a title) , openShadowbox('toppano/page1.html', 'a title'),  the same with "onclick=" at the beginning...

How do I write it?When I click on the hotspot nothing happens

Im developing it locally on Wamp.. I've allowed my Wamp folder, the panotour folder in Global Security Settings panel of Flash player..still doesn't work..

The shadowbox works coz Ive tried it with a normal <a> link

I really need some help on that! Thanks

Offline

 

#11 2012-12-20 07:56:28

bdd
Administrator
Registered: 2011-01-18
Posts: 622
Website

Re: javascript hotspot

Hello Beru,

Did you set "localhost" in the available domains for your tour ?
With 1.8 version of PTP, you need to use Domains restriction to be able to call JS functions from your flash tour.

Gérald

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson