<script type= "Text/javascript" > $ (function () {var imglist = document.getElementsByTagName ("I MG "); The Android 4.0+ version does not support Window.screen.width, and the Android 2.3.3 system supports VAR _width; Dodraw (); Window.onresize = function () {//Capture the screen window changes, always ensure that the picture according to the screen width of the reasonable display dodraw (); } function Dodraw () {_width = window.innerwidth; for (var i = 0, len = imglist.length; i < Len; i++) {DrawImage (imglist[i], _width); }} function DrawImage (IMGD, _width) {var image = new Image (); IMAGE.SRC = IMGD.SRC; Image.onload = function () {//limit, only images with a width greater than 30 are displayed if (Image.width > &&am P Image.height >) {if (Image.width > _width) {imgd.width = _wid Th Imgd. Height = (image.height * _width)/image.width; } else {imgd.width = Image.width; Imgd.height = Image.height; }}}}) </script>
Mobile phone-side picture adaptive screen size