Hi, all
I want to close with a plugin button the window and leave krpano
have you a action for that
java ? or other
thanx
Hi, all
I want to close with a plugin button the window and leave krpano
have you a action for that
java ? or other
thanx
Hi Job1,
Javascript has the close method to close windows: close(), self.close() or window.close()
It seems to not be so easy.... There is some security limitation when trying to close a window that has not be opened by a JavaScript ....
More info here: http://docs.sun.com/source/816-6408-10/window.htm#1201822
SAlut.
Merci Michel
Thanx Michel
Mais j'y arrive pas !!
But I can't do anything !!
Hi job.1,
It seems that to be able to close() a window, that window must have be opened by a JavaScript ... otherwise, the close() does not work for security reason. (references here )
So, you must first open that window using a JavaScript code... Here an example code (references here ):
<html>
<head>
<title>Open your krpano window</title>
</head>
<body>
<center>
<br><br><br>
<FORM NAME="myform">
<INPUT TYPE="button" NAME="Button1" VALUE="Open Sesame!"
onClick="window.open ('http://Your_Krpano_Page_To_Be_Loaded.html', 'newWin')">
</FORM>
</center>
</body>
Display More
To be able to close the window, you can add into Your_Krpano_Page_To_Be_Loaded.html the following JavaScript code:
<script type="text/javascript">
// <![CDATA[
function CloseMyWindow() { top.window.close(); }
// ]]>
</script>
And into your Krpano.xml something like a button to call the CloseMyWindow() function:
<plugin name="close" keep="true" style="buttonstyle"
html="[p]close[/p]"
align="bottom" x="120" y="75"
onclick="js(CloseMyWindow();)"
/>
I have tried, and for me it works...
Hope this can help. ( t'énerve pas )
SAlut.
Super Michel
Je teste cette affaire, merci pour ton travail
I try this and come back here
Hello, All.
I try this code in html:
<script type="text/javascript">
// <![CDATA[
function CloseMyWindow() { top.window.close(); }
// ]]>
</script>
And this in xml:
<plugin name="close" url="buttons/close.png"
align="righttop" edge="center" x="26" y="19" alpha="0" keep="true"
onloaded="tween(alpha,get(btp),get(spl1));"
onclick="js(CloseMyWindow();)"
onhover="showtext('%A0Close%A0',system2);"
onover="tween(alpha,1,0.1);"
onout="tween(alpha,get(btp),get(spz),easeInQuad);"
/>
My 'close' button work good in Opera >=10.10 and IE >= 7.
But it don't work in Firefox 3.6.10.
What could be the problem?
Hi Folks,
I have the following code set up. Idea is to have the mobile version of the tour open up in an overlay to fill the entire phone screen (100%x100%), with a button inside the KRPano window which will close that overlay. The same button will also stop the soundinterface.js at the same time.
krpano xml:
<action name="audio stop">
stopsound(audiotrack);
</action>
<plugin name="close"
url="close.png"
devices="mobile"
align="topright"
edge="topright"
x="15"
y="15"
keep="true"
visible="true"
alpha="1"
onclick="document.getElementById('virtual-tour-02').style.display='none';document.getElementById('vt-02').style.display='none';action(audio stop);"
/>
Display More
html:
<div id="virtual-tour-02" class="overlay-item" style="text-align:right;">
<div class="overlay-title" style="text-align:left;">Explore 720° Panorama</div>
<div class="overlay-close">
<a href="javascript:;" onclick="document.getElementById('virtual-tour-02').style.display='none';document.getElementById('vt-02').style.display='none';">
</div>
According to the client, the "close" button inside KRPano is not working at the moment, although the overlay closes successfully when it is closed from outside the KRPano window. I've got the hang of the KRPano xml but the integration with the HTML/JS code on the website itself is a real weakness of mine.
Any pointers/suggestions, as ever, are greatly appreciated.
Malcolm
Make a javascript function
http://www.w3schools.com/js/js_functions.asp
https://krpano.com/docu/actions/#js
<script type="text/javascript">
<!--//--><![CDATA[//><!--
function closeit {
document.getElementById('virtual-tour-02').style.display='none';
document.getElementById('vt-02').style.display='none';
}
//--><!]]>
</script>
onclick="js(closeit())"'
I'm guessing this is mobile flash only. Using a box this way for iphones would likely cause dpi issues.
Don’t have an account yet? Register yourself now and be a part of our community!