Created
February 2, 2013 05:12
-
-
Save vumanhcuongit/4696190 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
| <script src="jquery.masonry.min.js" type="text/javascript"></script> | |
| <script src="jquery.infinitescroll.min.js" type="text/javascript"></script> // thu vien moi, luu y: xep dang sau masonry.min.js | |
| <script type="text/Javascript"> | |
| $(document).ready(function () { | |
| init(); | |
| }); | |
| function init() { | |
| var $container = $('#container'); | |
| $container.imagesLoaded( function(){ | |
| $container.masonry({ | |
| itemSelector : '.box' | |
| }); | |
| }); | |
| // PHAN MOI THEM VAO | |
| $container.infinitescroll({ | |
| navSelector : '#page-nav', // selector for the paged navigation | |
| nextSelector : '#page-nav a', // selector for the NEXT link (to page 2) | |
| itemSelector : '.box', // selector for all items you'll retrieve | |
| loading: { | |
| finishedMsg: 'No more pages to load.', | |
| msgText: "<em>Loading the next set of images...</em>" | |
| } | |
| }, | |
| // trigger Masonry as a callback | |
| function( newElements ) { | |
| // hide new items while they are loading | |
| var $newElems = $( newElements ).css({ opacity: 0 }); | |
| // ensure that images load before adding to masonry layout | |
| $newElems.imagesLoaded(function(){ | |
| // show elems now they're ready | |
| $newElems.animate({ opacity: 1 }); | |
| $container.masonry( 'appended', $newElems, true ); | |
| }); | |
| } | |
| ); | |
| //end func | |
| } | |
| </script> | |
| /* PHAN CHUA HINH */ | |
| <div id="container"> | |
| <div class="box photo col3 masonry-brick" > | |
| <a href="http://www.facebook.com/photo.php?fbid=3862598492298&set=a.1461090096089.63286.1498535627&type=1"> | |
| <img alt="526779_3862598492298_1890594693_n" src="https://sphotos-a.xx.fbcdn.net/hphotos-ash3/s720x720/526779_3862598492298_1890594693_n.jpg" /> | |
| </a> | |
| </div> | |
| <div class="box photo col3 masonry-brick" > | |
| <a href="http://www.facebook.com/photo.php?fbid=3862598492298&set=a.1461090096089.63286.1498535627&type=1"> | |
| <img alt="526779_3862598492298_1890594693_n" src="https://sphotos-a.xx.fbcdn.net/hphotos-ash3/s720x720/526779_3862598492298_1890594693_n.jpg" /> | |
| </a> | |
| </div> | |
| </div> | |
| <!-- contains the content to be loaded when scrolled --> | |
| <nav id="page-nav"> | |
| <a href="pages/2.html"></a> /* Nhung link da paginate*/ | |
| <a href="pages/3.html"></a> | |
| </nav> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment