javascript - ExtJS web display are different in Chrome toggle device mode and mobile browser -


hi tried build web application can used via mobile browser.

first, develop web , simulate mobile mode via chrome.

enter image description here

however, use mobile connected site, display not same chrome.

enter image description here

i have no idea fix problem. give me suggestions or key words google?

thanks

i found solution.

in ext-all.js, there function initmeta set meta.

initmeta: function() {                 var me = this,                     maxscale = me.maxuserscale || 1;                  me.addmeta('viewport', 'width=device-width, initial-scale=1, maximum-scale=' +                        maxscale + ', user-scalable=' + (maxscale !== 1 ? 'yes' : 'no'));                 me.addmeta('apple-mobile-web-app-capable', 'yes');             }, 

we can modify initial-scale value make less 1.

hope trick others.

update

i think better way avoid modify ext-all.js.

when app.js execute launch function add these code:

launch: function() {     if (ext.supports.touch) {         var head = ext.gethead(),             viewportmeta = head.dom.getelementsbytagname('meta')[0];          viewportmeta.setattribute('content', 'width=device-width, initial-scale=0.5, maximum-scale=1, user-scalable=yes');     } } 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -