3

I have an issue with iScroll when I change the orienatation from portrait to landscape. It is working on AppMobi XDK, but on iPhone, it is not rendering properly. I have tried to trap the orientationchange event and called the refresh method of iScroll with different timeout values, but no luck.

// My code sample for the orientation change event
document.addEventListener("appMobi.device.orientation.change", orientationChange, false);
function orientationChange(){       
    setTimeout(function () { myScroll.refresh() }, 0);  
    //alert("Orientation Change");
}

Can anyone help?

Teun Zengerink
  • 4,277
  • 5
  • 30
  • 32

1 Answers1

0

you can try the event resize

window.addEventListener("resize", function() {
// Get screen size (inner/outerWidth, inner/outerHeight)
}, false);
fuqi
  • 66
  • 1
  • 2