Solved

Jquery to make the page smaller?

Posted on 2016-08-08
3
44 Views
Last Modified: 2016-08-08
Hi, I have pages of news articles that get really long: http://www.magickitchen.com/news/health.html

Can I use jquery or ajax to do something like this?:

It would be great to show the top six articles, then have a Plus sign or a see more button, ad have the rest of the content appear on the same page. I'm learning jquery and ajax,  but I'm not sure yet how to use them in real world applications. So I could use some advice and some examples, if possible. Thanks!
0
Comment
Question by:mel200
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
Alexandre Simões earned 500 total points
ID: 41747313
Depending on the amount of data, you might actually consider two approaches:

1. Real lazy-loading
If you really have a lot of items which, in my opinion, is not the case of the page you gave us as an example, then you can create a lazy loading feature like adding a "More" button.
This is like a paged list, meaning that on the server-side you need to have method that receives the page number and page size and gives you the items for that page.
Once you have that, then just append the items to the HTML.

2. Fake lazy-loading
On the other hand, if this is just to make things pretty, then you can just fake this paging mechanism.
You can still have the whole HTML on the page but only show it gradually.

It's your call :)
1
 

Author Comment

by:mel200
ID: 41747329
Thanks; do you have examples of these? :)
0
 

Author Closing Comment

by:mel200
ID: 41747367
Thanks, I found examples. Good solutions
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
razorCMS: Change Menu Font 4 24
jqplot Pie Chart 2 16
Re-position the objects 7 50
Uncaught TypeError: can't read property 1 15
This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now