• 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 ):


    To be able to close the window, you can add into Your_Krpano_Page_To_Be_Loaded.html the following JavaScript code:

    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:

    Code
    <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 *wink* )

    SAlut.

  • Hello, All.
    I try this code in html:

    Code
    <script type="text/javascript">
    // <![CDATA[	
    	function CloseMyWindow() { top.window.close(); }
    // ]]>
    </script>


    And this in xml:

    Code
    <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:

    html:

    Code
    <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

    Code
    <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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!