Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Apr 2016
    Posts
    717
    Member #
    53891
    Liked
    11 times

    scroll and activate

    i have a long list that is too long to display fully. i want to use javascript hide lets say items 10 through 20 and display them when the user scrolls down to the end of the visible list i.e item 10. any ideas how thats done?

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    This depends on how you are creating the web page. If it's dynamic, created by PHP and SQL database, it would be done with AJAX (PHP and JQuery). It also depends on what the data is. I think we need more specific information to give you a proper answer. Give us a link to your web page with the long list and how you are generating that list.


  4. #3
    Senior Member
    Join Date
    Apr 2016
    Posts
    717
    Member #
    53891
    Liked
    11 times
    i dont have anything down on paper just yet but its like this. say we have a unordered list with 30 list items. the first 10 have an id and are set to display: block. then 10 through 20 and 20 through 30 are set to display: none. when the user scrolls to the end of the first 10 i.e. when the last item becomes visible in screen once scrolled down to the 10 through 20 items become visible

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    This is pretty close:
    https://codepen.io/elmahdim/pen/sGkvH

    It has a "load more" button, but maybe that could be modified.

    That's just one JQuery example ... there are probably hundreds more.
    If your page is generated by PHP w/SQL database, that changes everything.
    It would all be dynamic (AJAX operations).



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:09 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com