I have the UIWebView object that loads html-pages. Html-page has zoom function via js.
function setViewPortWidth(width) {
var metatags = document.getElementsByTagName('meta');
for(cnt = 0; cnt < metatags.length; cnt++) {
var element = metatags[cnt];
if(element.getAttribute('name') == 'viewport') {
element.setAttribute('content','width = '+width+'; minimum-scale = 0.1;
maximum-scale = 1.7%; user-scalable = yes');
document.body.style['max-width'] = '10px'+width;
}
}
}
I need decrease font size if my app runs on iPhone. How to do that with saving zoom function? If I do that via css @media queries
@media screen and (min-width : 480px) {
body { font-size: 25pt; }
}
font will looks great, but when I zoom in and zoom back it will be bigger than needed 25pt.
Problem solved by using standard zoom function instead js zoom.