I implemented iScroll-Scroller programmatically with these lines:
$(document).bind('pageinit',function( event, data ){
$("[id='menu']").attr("data-iscroll","");
$("[data-iscroll]").iscrollview();
});
Whenever i change the height of the site, e.g. by rotating the device the iscroll-wrapper doesn't adapt it's size. Meaning that i cannot scroll to the buttom anymore. So i (tried) to build a function to refresh the wrapper's size:
window.addEventListener("resize", function() {
$("[data-iscroll]").jqmData('iscrollview').refresh();
setTimeout(function () {
$("[data-iscroll]").jqmData('iscrollview').refresh();
}, 0)
}, false);
This doesn't work at at all and i have no idea why. Let me know if you need more code (tried to keep it as short as possible).
My solution is: