Monday, April 11, 2011

Tutorial: Jquery Image Lazy Load


Hai korang , hari ni aku nak buat tuto pasal jquery lazy load . Ini khas untuk blog yang berat and ada gambar banyak . Kira kalau guna tuto ni blog korang jadi ringan macam tu . Kalau nak ikut step kat bawah .

1 Dashboard > Layout > Add Gadget > Choose HTML/Java Script

2 Copy code kat bawah ni
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js' type='text/javascript'></script>
<script type='text/javascript' src='https://sites.google.com/site/jquery01/jquery.lazyload.mini.js?ver=1.5.0'></script>
<script type="text/javascript">
jQuery(document).ready(function($){
if (navigator.platform == "iPad") return;
jQuery("img").lazyload({
effect:"fadeIn",
placeholder: "http://3.bp.blogspot.com/_LZtXSNcp76A/THkEtEOZfrI/AAAAAAAABRo/IARVMD_8TwA/s1600/grey.gif"
});
});
</script>
3 Pastekan dalam kotak gadget and save template .

No comments: