Jump to content

Tips for mobile browsers


Farshad Mohajeri
 Share

Recommended Posts

  • Administrators

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);

Link to comment
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.

Link to comment
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????

Link to comment
Share on other sites

  • Administrators

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

Link to comment
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.

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

  • 1 year later...

 

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

Link to comment
Share on other sites

  • 3 months later...
 Share

×
×
  • Create New...