PDA

View Full Version : window.scrollto does not work in production build + Android



shwetapande10
27 Jul 2012, 1:00 AM
Hi All,

I have added the following code to hide the address bar. This works fine in development version, but not in production and testing builds. :s I have tested this on my Android phone (OS - 2.3.3)
Please help!
Please find the code to hide address bar below:-


<script>
function hideAddressBar()
{
if(!window.location.hash)
{
if(document.height < window.outerHeight)
{
document.body.style.height = (window.outerHeight + 50) + 'px';
}


setTimeout( function(){ alert('scroll to');window.scrollTo(0, 1); }, 50 );
}
}


window.addEventListener("load", function(){ if(!window.pageYOffset){ hideAddressBar(); } } );
window.addEventListener("orientationchange", hideAddressBar );
</script>

scottmartin
27 Jul 2012, 12:03 PM
Can you provide more details ...

-Is this a touch app or a ExtJS app?
-Version used
-Browser/OS used in development

Scott.