mui 浏览器一样自动缩放
<!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=5,user-scalable=yes" /> <link href="../../css/mui.min.css" rel="stylesheet" /> </head> <body> <script src="../../js/mui.min.js"></script> <script type="text/javascript"> mui.init(); mui.plusReady(function() { plus.webview.currentWebview().setStyle({ scalable: true }); }); </script> </body> </html>
1. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=5,user-scalable=yes" />
2. mui.plusReady(function() {
plus.webview.currentWebview().setStyle({
scalable: true
});
});
请注意meta标签中的 minimum-scale=1,maximum-scale=5,user-scalable=yes 三个参数的设置,来实现可缩放,以及缩放的范围。