We are Designers, We are Developers,We are Thinkers,
We are Strategists

How to auto load the content on page scroll

 
  • 0
Auto load the content on page scroll

Introduction:
This technique is used in Twitter, Facebook and several other websites. New Facebook is using this technique to load more posts and updates. when the user scroll down the page all the old posts are displayed on the screen.

Step1: Create mysql table

CREATE TABLE IF NOT EXISTS `messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `message` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ;

Step2: Create config file for database connection – config.php:

Step3: Now display latest messages – index.php:

Step4: Javascript Code in index.php page head section:


Step5: loadmore.php:


  • 0){?>

    Step6: Add css for better design:

    Conclusion:
    Now, you can use this technique to load your feed easily.

    Leave a Reply