0

My friends, I am having a trouble to load more messages when I scroll down. Initially I want latest messages. When the user scrolls, I want to load the another limited set of messages. When user scrolls again the next set loads. Similar to Facebook messages.

this is my code.

{
    <div id="msgboxfully" style ="height:345px; width:100%;overflow:hidden; overflow-y:scroll;display: flex;flex-direction: column-reverse;">
    <ul id="uuuut">
    <li id="jqmsglist">
    <div class="msg-shower_new">
    <img src="$msgs3frm_img}" />
    <div class="text-box" style="margin-top:10px;">
    <sh2><a class="msg-shower_new" href="./$msgs3frm_usn">$msgs3frm_usn</a></sh2> <sh1 style="float:right;line-height:35px;color:#a5a5a5;">$msgs3date}</sh1>
    </div>
    <div class="text-box" style="margin-top:-2px;">
    <sh1>$msgs3msg</sh1>
    </div>
    </div>
    </li></ul></div> 
}

this code is looping and i have 100+ messages in one conversion. please help me

masterFly
  • 1,047
  • 8
  • 20
  • Please be more specific about what you need help with. – Genie Kort Sep 15 '16 at 11:26
  • You need to listen to the scroll event and when you've scrolled low enough send an AJAX request to retrieve more messages. There's probably online tutorials that explain how – apokryfos Sep 15 '16 at 11:30
  • Possible duplicate of [How to lazy load items from mysql db like facebook and twitter (infinite scrolling)](http://stackoverflow.com/questions/8059773/how-to-lazy-load-items-from-mysql-db-like-facebook-and-twitter-infinite-scrolli) – user2182349 Sep 15 '16 at 11:41
  • first time show only limited massages and when scroll down showing other messages – Sasindu Jayampathi Sep 15 '16 at 11:45

0 Answers0