Advertisement
asimryu

pdf test -list.php

Jun 2nd, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. <?php require("dbcon.php"); ?>
  2. <!DOCTYPE html>
  3. <html lang="ko">
  4. <head>
  5. <meta charset="UTF-8">
  6. <title>Document</title>
  7. <style>
  8. body { font-size: 30px; }
  9. </style>
  10. </head>
  11. <body>
  12. <div id="newslist"></div>
  13. <script src="http://code.jquery.com/jquery-latest.js"></script>
  14. <script>
  15.  
  16. var page = 0;
  17. var scrollEnd = false;
  18. newList();
  19. function newList(){
  20. if( scrollEnd == true ) return;
  21. $.get("newslistview.php?page=" + page,
  22. function(data){
  23. if( data ) {
  24. $("#newslist").append(data);
  25. page++;
  26. } else {
  27. scrollEnd == true;
  28. }
  29. }
  30. );
  31. }
  32.  
  33. $(window).scroll(function(){
  34. var sh = $(document).height();
  35. var sp = $(window).height() + $(window).scrollTop();
  36. if( (sh-sp) / sh == 0 ){
  37. newList();
  38. }
  39. });
  40. $("#newslist").on("click",".del",function(){
  41. $(this).parent("p").parent("div").hide();
  42. newList();
  43. });
  44.  
  45. </script>
  46. </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement