Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://stackoverflow.com/questions/8352372/how-to-add-load-more-button-for-a-html-css-page
- $(function(){
- $("div").slice(0, 10).show(); // select the first ten
- $("#load").click(function(e){ // click event for load more
- e.preventDefault();
- $("div:hidden").slice(0, 10).show(); // select next 10 hidden divs and show them
- if($("div:hidden").length == 0){ // check if any hidden divs still exist
- alert("No more divs"); // alert if there are none left
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement