You are not logged in.


Thursday, April 25th 2019, 6:32am

Embedded Pano has height of 0px.

I'm just starting with Krpano, and am having a problem with embedding it in a webforms site. The krpanoSWFObject is there when I inspect the site, but has a height of 0px, so is invisible. I am getting no errors regarding missing files or incorrect paths, and was hoping someone might be able to spot what I'm doing wrong.
Thanks in advance.
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">

<div class="container-fluid">

<script src="Krpano/vtour/tour.js"></script>

<div class="row">
<div class="col-sm-3">
<h3>Hello from col 1</h3>
<div class="col-sm-9" id="pano1">
<h3>Hello from col 2</h3>
embedpano({ swf: null, xml: "Krpano/vtour/tour.xml", target: "pano1", localfallback: "http://localhost:8090", html5: "auto" });
var krpano1 = document.getElementById("krpanoSWFObject");"loadpano('tour.xml', null, null, NOBLEND);");




Thursday, April 25th 2019, 6:41am


you would need to define a size for the html element where the viewer gets embedded - e.g. this way:

Source code

<div class="col-sm-9" id="pano1" style="height:400px;">

Best regards,


Thursday, April 25th 2019, 12:42pm

Many thanks Klaus, that's great. I'd assumed it would auto size it due to the 100% settings elsewhere, and given that it was giving it a width according to the size of the browser, it didn't occur to me that it would require a px value just for the height.
Further lessons in not assuming learnt!


Thursday, April 25th 2019, 4:18pm


there is a width automatically given because it's a 'div' element, that means it will extend the horizontal space,
but at least vertical size need to be defined, otherwise what size should it use? ;-).

Generally said - the size is always given by the web-design and the viewer will resize itself to that size.

Best regards,