Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require("dbcon.php"); ?>
- <!DOCTYPE html>
- <html lang="ko">
- <head>
- <meta charset="UTF-8">
- <title>Document</title>
- <style>
- body { font-size: 30px; }
- </style>
- </head>
- <body>
- <div id="newslist"></div>
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <script>
- var page = 0;
- var scrollEnd = false;
- newList();
- function newList(){
- if( scrollEnd == true ) return;
- $.get("newslistview.php?page=" + page,
- function(data){
- if( data ) {
- $("#newslist").append(data);
- page++;
- } else {
- scrollEnd == true;
- }
- }
- );
- }
- $(window).scroll(function(){
- var sh = $(document).height();
- var sp = $(window).height() + $(window).scrollTop();
- if( (sh-sp) / sh == 0 ){
- newList();
- }
- });
- $("#newslist").on("click",".del",function(){
- $(this).parent("p").parent("div").hide();
- newList();
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement