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.
however, use mobile connected site, display not same chrome.
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
Post a Comment