calling javascript function in 5.1

Q&A about the latest versions
Post Reply
JVaron
Posts: 16
Joined: Tue Feb 14, 2017 4:41 pm

In versions 4.x and 5, I have been using Fancybox to create add lightboxes containing slideshows, video clips and text. This method is not working in the 5.1 beta.

For example, here's what I've been doing to add lightbox overlays with text descriptions for each panorama. I like this method because it allows my clients to easily edit the text descriptions themselves.
1. Add a LaunchFancybox javascript function to the virtual tour's main html page.
2. In a subfolder called "text", I create separate html pages containing text descriptions for each panorama.
3. In my skin, I add a button with the "Go to URL" action, and type "javascript:LaunchFancybox(‘$ud’, 700, 470, 'iframe')" into the URL (but without the opening and closing quotes)
4. For each panorama in my tour, I add the path to it's text description page in the "Description" box in the "User Data" section. For example, I'd type "text/spin1.html" (but without the opening and closing quotes)

With 4.x and 5.0, this worked to load slideshows, text, videos from youTube or Vimeo, or other webpages into the lightbox.

But it doesn't in 5.1.

In testing, I've learned that it DOES work if I don't use the '$ud' in the button's action. So, if I type "javascript:LaunchFancybox(‘text/spin1.html’, 700, 470, 'iframe')" into the action, it's fine. But that method would require me to have a separate skin item for everything I want to put in the lightbox, which isn't really efficient.

Any ideas as to why 5.1 isn't allowing me to do this anymore?
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

HI JVaron,
Odd, have you tested with 5.1 beta 2?
I so and still not working can you post a project so I can have a look.
If you don't want to do it in open forum PM me or send an e-mail to support@ggnome.com with your project or link to it.
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/
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

The special handling of the placeholders caused a lot of issues with the quote signs and other stuff, so I removed the expansion of the placeholders.
Instead you can now use the more flexible javascript API within the skin. In in your case

Code: Select all

javascript:LaunchFancybox(pano.userdata.title, 700, 470, 'iframe');
should do the trick.
MfG, Thomas
JVaron
Posts: 16
Joined: Tue Feb 14, 2017 4:41 pm

Thanks, Thomas! That did it.
JVaron
Posts: 16
Joined: Tue Feb 14, 2017 4:41 pm

I need to use this LaunchFancybox script to open a lightbox from a clicked hotspot.

In pre 5.1, I used the following script--- javascript:LaunchFancybox ('$hu', 700, 470, 'iframe'), which would grab data from the hotspot URL field and place it in the lightbox.

What do I replace '$hu' with?
IronWagen
Posts: 47
Joined: Mon Nov 30, 2015 4:34 pm

me.hotspot.url
Post Reply