Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <script language="Javascript">
  2.  
  3. var lastScrollTop = 0;
  4. $(window).scroll(function(event){
  5. //load when user scrolls to the bottom
  6. openFromButton()
  7. });
  8.  
  9. function openFromButton(lastLoadedIndex) {
  10.  
  11. lastLoadedIndex = (typeof(lastLoadedIndex)=='undefined') ? '' : lastLoadedIndex;
  12.  
  13.  
  14. document.getElementById('load').style.display = 'block';
  15. document.getElementById('more').style.display = 'none';
  16.  
  17. jQuery.get('liste_ticket_pl_rows.asp?from_item='+ lastLoadedIndex +'&param='+(new Date()).getTime(),
  18.  
  19. function(data) {
  20.  
  21. jQuery('.liste).append(data);
  22.  
  23. if (data) {
  24. var len = data.match(/<tr class='k'>/g).length;
  25. }
  26.  
  27. if ((data) && (len >= 10)) {
  28. document.getElementById('load').style.display = 'none';
  29. document.getElementById('more').style.display = 'block';
  30.  
  31. }
  32. else{
  33. //No data
  34. document.getElementById('load').style.display = 'none';
  35. document.getElementById('more').style.display = 'none';
  36. }
  37.  
  38. });
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement