Changing Viewer Size - What Am I Doing Wrong?

  • Can someone help me with this code? I am trying to build my own website, never done this before. I have the viewer displaying with the text above it, but for some reason when I change the <div> height, nothing happens? I can change the width just fine, but not the height. My only experience is editing pages that were already created, this is my first attempt at building from scratch, so if my code looks funny tell me, I won't be offended.


    <!DOCTYPE html>
    <!-- Daniel Sullivan & Company java test -->

    <html lang="en">
    <head>

    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />

    <meta charset="UTF-8" />
    <title>
    Daniel Sullivan & Co.
    </title>
    <link rel="stylesheet" type="text/css" HREF="main.css" />
    </head>
    <body>


    <h1>
    Virtual Tours
    </h1>
    <p>
    Atomic Audio
    </p>


    <script src="/Users/dsully15/Desktop/atomicaudio/tour.js"></script>

    <div id="pano" style="width:100%; height:100%;"></div>

    <script>
    var viewer = createPanoViewer({swf:"/Users/dsully15/Desktop/atomicaudio/tour.swf", target:"pano"});
    viewer.addVariable("xml", "/Users/dsully15/Desktop/atomicaudio/tour.xml");
    viewer.embed();
    </script>


    </body>
    </html>

  • Hi,

    in html a percent size (like the 100% height for the pano <div>) is alway referring to its parent element (in this case the <body>) element, and so the parent element also needs to have a size to work correctly.

    That means assign 100% height to the body and html elments too.

    Best regards,
    Klaus

Participate now!

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