You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, April 24th 2013, 5:32pm

Open external HTML pages in a lightbox window from a tour?

I am wondering if anybody can share an example for the code to be used for a hotspot by clicking on which a new window with external HTML page would open in a lightbox window?
Like for example on the site http://altbier.com.ua/walk.php?pano=3221_7&lang=1#3221_7 - if you hover a table you will see a plate. If you click on the plate there is a pop-up - a lightbox window with a form (that is external HTML page). Any help will be highly appreciated!

reza_shnia

Intermediate

Posts: 168

Occupation: krpano freelancer || creating ideas & coding them || krpano developer

  • Send private message

2

Friday, April 26th 2013, 6:45am

you should use JQuery for this job.
1.make a function in your html page to build lightbox window.
2.call this function in krpano by this command : js( ...Javascript code... )
http://krpano.com/docu/actions/#js


sampel :
+ fist of all import FancyBox library to your html page.
http://fancybox.net/howto

+ then use this function to build lightbox window :

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function popup()
{
	$.fancybox(
    	'YOUR-HTML-ADDRESS/FILENAME.html',
    	{
        	'width'            	: '100%',
        	'height'        	: '100%',
        	'autoScale'     	: false,
        	'transitionIn'    	: 'none',
        	'transitionOut'    	: 'none',
        	'type'            	: 'iframe'
    	}
	);
};


+ and call the popup function in krpano by this code :

Source code

1
onclick="js( popup() );"


NOTE:
Flashplayer Notes - this action requires the External Interface of the Flashplayer! This means the action will
work offline/locally only when the security settings of the Flashplayer were adjusted.
See here for more detatils - Local / Offline Usage.

3

Monday, April 21st 2014, 1:53am

Hi thanks, i have try to open my page with the testing server of krpano, but the fancybox is not working.

In html page i have added this code:
########################################################
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript">
function popup()
{
$.fancybox(
'http://www.mywebsite.it',
{
'width' : '100%',
'height' : '100%',
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
}
);
};
</script>
</head>
<body>
########################################################

in xml file this code:

<hotspot name="q2" url="JP/JP_info-icon.png" ath="-42.032" atv="31.684" scale="1" onhover="showtext(Info sul Virtual Tour, style1);" onclick="js( popup() );" />

#######################################################

Where is the problem?
Thanks.