Question

I'm working on a Windows 8 app in Html, CSS and JavaScript. In snapped view will some screens not be able to see the whole content, and that's why I want a vertical scrolling.

How can I fix that? I would like to have it in html or CSS.

HTML:

<section aria-label="Main content" role="main">
        <div class="divContainer" style="width: auto; height: auto; overflow:auto; display: -ms-grid; 
            -ms-grid-columns: 450px 50px 450px 46px 250px; 
            -ms-grid-rows: auto">
            <div id="pageCalc">
                <h2>User information</h2>
                ... 
                Some text here
                ...
            </div>
            <div id="pageText">
                <h2>Contact information</h2>
                ...
                Some text here
                ...
                <img id="imageDiv" src="/images/aboutlogo.png" border="0" alt="">


            </div>
            <div id="pageAdd">
                ...
                An add here
                ...
            </div>
        </div>
    </section>

The #pageText, #pageAdd and #pageCalc's Width, height and stuff like that is definated in the css, and then in snapped view, it uses this piece of code:

CSS:

@media screen and (-ms-view-state: snapped) {
.about section[role=main] {
    margin-left: 20px;
    margin-right: 20px;
}

.divContainer {
    height:1080px;
    width: 230px;
    display:-ms-grid;
    -ms-grid-column: 230px;
    -ms-grid-row: auto 20px auto 20px auto;
    overflow: auto;

}

#pageCalc, #pageText, #pageAdd {
    width: 230px;
}

#pageCalc {
    -ms-grid-column: 1;
    -ms-grid-row: 1;
}

#pageText {
    -ms-grid-column: 1;
    -ms-grid-row: 3;
}

#pageAdd {
    -ms-grid-column: 1;
    -ms-grid-row: 5;
}

}

Was it helpful?

Solution

Win8 apps in html, css and JavaScript are running on Microsoft WWA Host process. That is internet explorer-based rendering platform. So you make your application as you will make it on IE. Just wrap your snapped content into a div with fixed height and with overflow: auto and you will have a vertical scroll.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top