Jump to content
uniGUI Discussion Forums
Farshad Mohajeri

Tips for mobile browsers

Recommended Posts

Below meta displays page in a 1/1 scale and also disables browser in-zoom/out-zoom function. It should be added to servermodule.CutsomMeta.

 

<meta content='True' name='HandheldFriendly' />
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />

 

Below script disables moving the page around inside the browser window. Add this to MainForm.Script

 

document.body.addEventListener('touchmove',function(event){
 event.preventDefault();
},false);

Share this post


Link to post
Share on other sites

Below meta displays page in a 1/1 scale and also disables browser in-zoom/out-zoom function. It should be added to servermodule.CutsomMeta.

 

<meta content='True' name='HandheldFriendly' />
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />
<meta name="viewport" content="width=device-width" />

 

Below script disables moving the page around inside the browser window. Add this to MainForm.Script

 

document.body.addEventListener('touchmove',function(event){
 event.preventDefault();
},false);

 

Thank you. This is an important aspect of the current applications. It is a big increment of the use of mobile devices and the applications from they.

Share this post


Link to post
Share on other sites

Two questions:

 

1- Why two times "viewport". Which is the difference between first and second????

 

2- I test and application in IPhone 4 and the loading image of Safari WebBrowser is showing intermittent after page is loaded like is still doing something or calling something to server. Why????

Share this post


Link to post
Share on other sites

Two questions:

 

1- Why two times "viewport". Which is the difference between first and second????

 

2- I test and application in IPhone 4 and the loading image of Safari WebBrowser is showing intermittent after page is loaded like is still doing something or calling something to server. Why????

 

Second "viewport" seems to be unnecessary. It is OK to remove.

 

BTW, it was Google knowledge. :)

Original source here:

 

http://garrows.com/?p=337

Share this post


Link to post
Share on other sites

Two questions:

 

1- Why two times "viewport". Which is the difference between first and second????

 

2- I test and application in IPhone 4 and the loading image of Safari WebBrowser is showing intermittent after page is loaded like is still doing something or calling something to server. Why????

 

I reply my self in second question:

 

There was a UniTimer with the property Enable := True. That was the cause.

Share this post


Link to post
Share on other sites

Below meta displays page in a 1/1 scale and also disables browser in-zoom/out-zoom function. It should be added to servermodule.CutsomMeta.

 

<meta content='True' name='HandheldFriendly' />
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />

 

Below script disables moving the page around inside the browser window. Add this to MainForm.Script

 

document.body.addEventListener('touchmove',function(event){
 event.preventDefault();
},false);

 

Do not work under FireFox Android.

Share this post


Link to post
Share on other sites

Hello, if you open this mobile prepared web in internet explorer 9 fails in the followed code:

 

document.body.addEventListener('touchmove',function(event){

event.preventDefault();

},false);

 

 

 

thanks

Share this post


Link to post
Share on other sites

 

Below meta displays page in a 1/1 scale and also disables browser in-zoom/out-zoom function. It should be added to servermodule.CutsomMeta.

 

<meta content='True' name='HandheldFriendly' />
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />

Below script disables moving the page around inside the browser window. Add this to MainForm.Script

 

document.body.addEventListener('touchmove',function(event){
  event.preventDefault();
},false);

Hi!

Code above does not work on Samsung Android browser.

I appreciate any idea or help.

Thanks in advance.

Voja

Share this post


Link to post
Share on other sites

×