/*工具类方法 ------------------------------------------------*/ //获取参数值 function getQueryStringByName(name) { var result = location.search.match(new RegExp("[\?\&]" + name + "=([^\&]+)", "i")); if (result == null || result.length < 1) { return ""; } return result[1]; } //获取图片高度 function getImageWidth(url, callback) { var img = new Image(); img.src = url; // 如果图片被缓存,则直接返回缓存数据 if (img.complete) { callback(img.width, img.height); } else { img.onload = function () { callback(img.width, img.height); } } }