1.磁盘图片缓存器DiskImageCache 1.1.这个类很多情况都可能用的到,耦合性很低,所以分开讲. 源代码: /* * Copyright 2017 GcsSloop * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a co…
缩放图片到合适大小 function ResizeImages() { var myimg, oldwidth, oldheight; var maxwidth = 400; var maxheight = 400 var imgs = document.getElementsByTagName('img'); //获取页面图片 这里使用document过去 for (i = 0; i <…