Skip to content

Commit

Permalink
Proper definition for update() function.
Browse files Browse the repository at this point in the history
  • Loading branch information
tuupola committed Feb 26, 2012
1 parent 447cbfc commit dcf62b7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
6 changes: 4 additions & 2 deletions enabled.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ <h2>Plugin enabled</h2>
$("img").lazyload();</pre>
</code>

<img src="img/grey.gif" data-original="img/bmw_m1_hood.jpg" width="765" height="574" alt="BMW M1 Hood"><br/>
<img id="firstx" src="img/grey.gif" data-original="img/bmw_m1_hood.jpg" width="765" height="574" alt="BMW M1 Hood"><br/>
<img src="img/grey.gif" data-original="img/bmw_m1_side.jpg" width="765" height="574" alt="BMW M1 Side"><br/>
<img src="img/grey.gif" data-original="img/viper_1.jpg" width="765" height="574" alt="Viper 1"><br/>
<img src="img/grey.gif" data-original="img/viper_corner.jpg" width="765" height="574" alt="Viper Corner"><br/>
<img src="img/grey.gif" data-original="img/bmw_m3_gt.jpg" width="765" height="574" alt="BMW M3 GT"><br/>
<img src="img/grey.gif" data-original="img/corvette_pitstop.jpg" width="765" height="574" alt="Corvette Pitstop"><br/>
<img id="lastx" src="img/grey.gif" data-original="img/corvette_pitstop.jpg" width="765" height="574" alt="Corvette Pitstop"><br/>

</div>
<div id="sidebar">
Expand All @@ -71,6 +71,8 @@ <h2>Plugin enabled</h2>
<script src="jquery.lazyload.js?v=3" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
console.log("first:", $.belowthefold("#firstx", {threshold : 100}));
console.log("last:", $.belowthefold("#lastx", {threshold : 100}));
$("img").lazyload();
});
</script>
Expand Down
15 changes: 13 additions & 2 deletions enabled_fadein.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h2>Plugin enabled with fadein effect</h2>
<code>
<pre>
$("img").lazyload({
effect : "fadeIn"
effect : "fadeIn"
});</pre>
</code>

Expand All @@ -73,7 +73,18 @@ <h2>Plugin enabled with fadein effect</h2>
<script type="text/javascript" charset="utf-8">
$(function() {
$("img").lazyload({
effect : "fadeIn"
effect : "fadeIn",
effect_speed : "foo",
appear : function(elements_left, settings) {
console.log("appear");
console.log(elements_left);
//console.log(this, elements_left, settings);
},
load : function(elements_left, settings) {
console.log("load");
console.log(elements_left);
//console.log(this, elements_left, settings);
}
});
});
</script>
Expand Down
9 changes: 7 additions & 2 deletions enabled_gazillion.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,16 @@ <h2>Plugin enabled with gazillion images</h2>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.scrollstop.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.lazyload.js?v=1602" type="text/javascript" charset="utf-8"></script>
<script src="jquery.lazyload.js
" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
console.log("foo");
$("img").lazyload({
event: "scrollstop"
event: "scrollstop",
callback : function(elements_left, settings) {
console.log(this, elements_left, settings);
}
});
});
</script>
Expand Down
6 changes: 3 additions & 3 deletions jquery.lazyload.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Project home:
* http://www.appelsiini.net/projects/lazyload
*
* Version: 1.7.1
* Version: 1.7.2
*
*/
(function($, window) {
Expand All @@ -30,7 +30,7 @@
load : null
};

update = function() {
function update() {
var counter = 0;

elements.each(function() {
Expand All @@ -51,7 +51,7 @@
}
});

};
}

if(options) {
/* Maintain BC for a couple of versions. */
Expand Down
4 changes: 2 additions & 2 deletions jquery.lazyload.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dcf62b7

Please sign in to comment.