Skip to content

Commit 6ab8269

Browse files
committed
add html addon
1 parent f4a913f commit 6ab8269

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/jquery.lazyloadxt.html.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*jslint browser:true */
2+
/*jshint browser:true, jquery:true */
3+
4+
(function ($) {
5+
'use strict';
6+
7+
var options = $.lazyLoadXT,
8+
lazyAttr = options.lazyAttr || 'data-lazy-src';
9+
10+
options.selector += ',[' + lazyAttr + ']';
11+
12+
$(document).on('lazyshow', '[' + lazyAttr + ']', function () {
13+
var $this = $(this);
14+
$this.load($this.attr(lazyAttr), function () {
15+
$this.triggerHandler('load');
16+
});
17+
});
18+
19+
})(window.jQuery || window.Zepto || window.$);

0 commit comments

Comments
 (0)