图片预加载插件如何实现高效优化?
- 内容介绍
- 文章标签
- 相关推荐
本文共计206个文字,预计阅读时间需要1分钟。
javascriptpreLoad.js(function($) { /* 构造方法 */ function preLoad(imgs, options) { this.imgs=(typeof imgs==='string') ? [imgs] : imgs; this.opts=$.extend({}, options); }})(jQuery);
preLoad.js(function ($) { /*构造方法*/ function preLoad(imgs, options) { this.imgs = (typeof imgs === 'string') ? [imgs] : imgs; //$.extend 用一个或多个其他对象来扩展一个对象,返回被扩展的对象。
本文共计206个文字,预计阅读时间需要1分钟。
javascriptpreLoad.js(function($) { /* 构造方法 */ function preLoad(imgs, options) { this.imgs=(typeof imgs==='string') ? [imgs] : imgs; this.opts=$.extend({}, options); }})(jQuery);
preLoad.js(function ($) { /*构造方法*/ function preLoad(imgs, options) { this.imgs = (typeof imgs === 'string') ? [imgs] : imgs; //$.extend 用一个或多个其他对象来扩展一个对象,返回被扩展的对象。

