Pannellum: Pannellum: autoload problem

Created on 14 Aug 2019  路  2Comments  路  Source: mpetroff/pannellum

Hi,

I'm using the autoload sample found in "https://pannellum.org/documentation/examples/auto-load/", I try to add a link, and only by clicking on the link, then the image inside a div section will pop up. If the autoload = true, then I found the image have problem loading, only if you click on the enlarge button then the image will shown correctly.

Sample of the code below, I just amend a little bit for the window popup.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="pannellum3.WebForm1" %>





Auto load







link


question

Most helpful comment

Next time, please include a complete example and don't include C# code, which is completely irrelevant.

While your code snippet doesn't include it, I'm assuming you're creating the Pannellum viewer with the #panorama <div> hidden, with the CSS display property set to none. This means that the <div> has a size of zero when it's created, which is why the panorama doesn't display. Either create the viewer with a visible element, or assign the viewer to a variable, e.g., var viewer = pannellum.viewer(...) and call viewer.resize() when you display it so it will use the displayed size.

All 2 comments

Next time, please include a complete example and don't include C# code, which is completely irrelevant.

While your code snippet doesn't include it, I'm assuming you're creating the Pannellum viewer with the #panorama <div> hidden, with the CSS display property set to none. This means that the <div> has a size of zero when it's created, which is why the panorama doesn't display. Either create the viewer with a visible element, or assign the viewer to a variable, e.g., var viewer = pannellum.viewer(...) and call viewer.resize() when you display it so it will use the displayed size.

Hi,

Thanks for your advice, I try assign the viewer to a variable and resize it when displayed, it works fine, thank you very much.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

truszko1 picture truszko1  路  5Comments

ThunderBoltEngineer picture ThunderBoltEngineer  路  3Comments

DStillingfleet picture DStillingfleet  路  7Comments

tomas-nz picture tomas-nz  路  4Comments

exotfboy picture exotfboy  路  3Comments