Version 1:
<style>
embed {
display: none;
}
</style>
<script>
var p1 = 0;
var p2 = 1;
var amount = 0;
/* var counter = 0; */
$(window).scroll(function() {
/*if(counter % 2 === 0){ */
if($(window).scrollTop() >= amount){
amount+=500;
if(!($('embed').slice(p1,p2).show())){
$(window).unbind("scroll");
}
++p1;++p2;
}
/* }
++counter; */
});
</script>
Version 2:
<style>
embed {
display: none;
}
</style>
<script>
var p1 = 0;
var p2 = 1;
/* var counter = 0; */
$(window).scroll(function() {
/*if(counter % 2 === 0){ */
if(!($('embed').slice(p1,p2).show())){
$(window).unbind("scroll");
}
++p1;++p2;
/* }
++counter; */
});
</script>
My attempts at making a Lazy flash loader (a flash loader which loads on demand), I am really proud of myself since I'm not a programmer. I came up with my own version after seeing that lazyLoader didn't do what I wanted, (frankly too complex for me too, lol). I use this on my blogger blog which loads zazzle gallery widgets and I think it's improved the loading times. I use version 2 without the scroll amount control.
Blog link: http://zazzlewidgets.blogspot.com
My questions are: 1. is it effective? I think the scroll amount control would improve things only when it gets larder. 2. How does my blog load? Do you see any improvements? 3. Do I use unbind accurately? Is it really unbinding? 4. Does my not expression really stop the slicing when it returns out of bounds? 5. What do you think? How can I improve it? :)
Thanks you, much appreciated for any constructive feedback :)