Can we execute javascript function from inside HTML5 pano?

Q&A about the latest versions
Post Reply
ScottWitte
Posts: 96
Joined: Wed Aug 29, 2007 9:33 pm
Location: Milwaukee, USA
Contact:

I would like to execute a javascript function (defined on the web page) as a result of clicking a button within an HTML5 pano. By my understanding this should easily be done using the "Go To URL" action. Instead of the URL being "http://mypage.html" it could be "javascript:my_function();" That substitution would work in a href link on the page. Why not an href link in the pano?
User avatar
Hopki
Gnome
Posts: 13021
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Scott
Have you tried it?
I have not as yet, but thats not to say it will or will not work.
Have a go and let me know how you get on.
Regards
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
ScottWitte
Posts: 96
Joined: Wed Aug 29, 2007 9:33 pm
Location: Milwaukee, USA
Contact:

Hopki wrote:Have you tried it?
An obvious question that I should have answered from the start.

Yes. I tried it but it didn't work and that makes no sense to me for the reason stated.

Thomas probably knows the answer to this. If there is no way to make it work currently it sure would be a great addition for a future release.
commodore64
Posts: 40
Joined: Mon Feb 16, 2009 11:38 am

Maybe you could edit the skin.js?
Look for "onclick".
ScottWitte
Posts: 96
Joined: Wed Aug 29, 2007 9:33 pm
Location: Milwaukee, USA
Contact:

"onClick" is one event that can initiate an action. In my case, yes I used it. The resulting action of executing javascript remains elusive. Makes no sense to me as to why. But I gather there are few who have an interest in doing something like this.

It is too bad. There is some great functionality that could be added to Pano2VR if it were possible. The sort of capabilities that are possible using actionscript in Flash, for instance. My immediate interest was to send tracking information to my analytics program. I wanted to know which panos are being looked at, for example.

Scott
commodore64
Posts: 40
Joined: Mon Feb 16, 2009 11:38 am

You could see stats on the server? (awstats)

javascript:alert(1);
works on buttons, but it seemed to open empty page also..
commodore64
Posts: 40
Joined: Mon Feb 16, 2009 11:38 am

hmm.. now I need this functionality also,
atleast it works, if you modify skin.js:

..
this.__div.onclick=function () {
me.skin.hotspotProxyClick(me.hotspot.id);
// your function call here (executed when hotspot is clicked)
..
Post Reply