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" %>
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.
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 CSSdisplayproperty set tonone. 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 callviewer.resize()when you display it so it will use the displayed size.