Reputation: 2039
I have seen some websites load static data on a page first, and in some part of it the dynamic data is loaded with jquery. For example please see this image:
At the moment, I fetch data from db using a simple mysql query, eg. select * from my_photos.
I don't know how to do this with jQuery and PHP, so I'd be thankful if you can give me some example.
Upvotes: 0
Views: 159
Reputation: 9825
If I understand your question correctly, you are looking to have static content (in this case images) loaded dynamically when users reach the part of the page they exist on.
Take a look at this plugin; I believe it is what you are referring to:
http://www.appelsiini.net/projects/lazyload
Good Luck!
Upvotes: 0
Reputation: 17885
You can use load() like this:
$('#div').load('sections.php #section1');
The #section1 part will filter out sections.php and only bring back the #section1 div, if you don't need it you can remove it.
Upvotes: 1