Jesus
Jesus

Reputation: 8586

how to add scroll to my WinJS app VS2012

I have a metro app (WinJS) in VS2012 which loads an image inside a by using an a from my local disk like which next function

function loadPictureFromFile(event) {

    var selectedFile    = event.target.files[0];
    var reader          = new FileReader();

    imageElement = document.createElement("img");               //creates <img id="img"> element
    imageElement.title = selectedFile.name;                     //set photo's name

    reader.onload = function (event) {
        imageElement.setAttribute("src", event.target.result);  //picture's source
        _divPicture.appendChild(imageElement);                  //Add's <img> element to Div element
    };

    reader.readAsDataURL(selectedFile);
}

but sometimes my image is too big to display on screen, it requires a scroll for viewing it completely, how to add it from javascript or WinJS after loading picture??

Upvotes: 0

Views: 89

Answers (1)

Jes&#250;s Ayala
Jes&#250;s Ayala

Reputation: 2791

in your default.css simply add

body {
    overflow-x:auto;
    overflow-y:auto;
}

Upvotes: 1

Related Questions