Lazy Load & Filtering

Macca

New Member
Oct 10, 2017
5
0
Hi!

Does anyone have any tutorials/examples of a working lazy load script with filtering options?

PHP with MySQLi, Jquery, and Ajax

Example:
Display data from database and when scrolling down it loads more from the database until none left. However I'd need it so people can search at the top and fetch the one they've searched without having to continue scrolling to find it.

I've found this but want to add filtering to it which filters everything in the database rather than just what's loaded.


Thanks in advance.
 
Last edited:

Macca

New Member
Oct 10, 2017
5
0
Any help appreciated.

I've found this but want to add filtering to it which filters everything in the database rather than just what's loaded.
 

Kurumi

New Member
Jul 28, 2015
13
6
My advice is to use a github library.
Very light as jquery code

The implementation is very simple.
You can also create the function to tell a specific element to load your Lazy.

Be horizontal or vertical.
So if you have for example Ajax
you must specify your class or id of your ajax images

The rest is the invisible line if you do not have the element on your screen that does not load.
If you make for example a pagination and go to page 2 this will load.

Ex:
Instance:
$('.lazy').Lazy({ // your configuration goes here scrollDirection: 'vertical', effect: 'fadeIn', visibleOnly: true, onError: function(element) { console.log('error loading ' + element.data('src')); } });

Parameter class optional:
var lazy = $('.lazy').Lazy({ chainable: false }); var attributeName = lazy.config('attribute'); // get lazy.config('effect', 'show');

// 'config' can receive entries or set them to a new value var value = instance.config('attribute'); instance.config('attribute', 'data-new-attribute'); // 'addItems' works with an jQuery object or any selector // so these two lines have the exact same result instance.addItems('img.new-items'); instance.addItems($('img.new-items'));

img atribute lazy or background automatily style
<div class="lazy" data-loader="customLoaderName"></div> <img class="lazy" data-src="path/to/image.jpg" />
 
Last edited:

Macca

New Member
Oct 10, 2017
5
0
My advice is to use a github library.
Very light as jquery code

The implementation is very simple.
You can also create the function to tell a specific element to load your Lazy.

Be horizontal or vertical.
So if you have for example Ajax
you must specify your class or id of your ajax images

The rest is the invisible line if you do not have the element on your screen that does not load.
If you make for example a pagination and go to page 2 this will load.

Ex:
Instance:
$('.lazy').Lazy({ // your configuration goes here scrollDirection: 'vertical', effect: 'fadeIn', visibleOnly: true, onError: function(element) { console.log('error loading ' + element.data('src')); } });

Parameter class optional:
var lazy = $('.lazy').Lazy({ chainable: false }); var attributeName = lazy.config('attribute'); // get lazy.config('effect', 'show');

// 'config' can receive entries or set them to a new value var value = instance.config('attribute'); instance.config('attribute', 'data-new-attribute'); // 'addItems' works with an jQuery object or any selector // so these two lines have the exact same result instance.addItems('img.new-items'); instance.addItems($('img.new-items'));

img atribute lazy or background automatily style
<div class="lazy" data-loader="customLoaderName"></div> <img class="lazy" data-src="path/to/image.jpg" />

I'm displaying 100's of items from the database. When adding the class Lazy to the div it doesn't seem to lazy load. Only seems to work on images.

Any chance you can help further?
 

Kurumi

New Member
Jul 28, 2015
13
6
I'm displaying 100's of items from the database. When adding the class Lazy to the div it doesn't seem to lazy load. Only seems to work on images.

Any chance you can help further?
Indeed, this allows the images to save resources.
very useful.

And look for you instead:

Load More Content On Scroll Down - Ajax Mysql

Do a google search :)
I think you have examples

and with even more add a filter with, finally a spanking possibility.
On the other hand, it is up to you to redo the code. and to check the code well before putting it in public, on google you never know!
 

Macca

New Member
Oct 10, 2017
5
0
Indeed, this allows the images to save resources.
very useful.

And look for you instead:

Load More Content On Scroll Down - Ajax Mysql

Do a google search :)
I think you have examples

and with even more add a filter with, finally a spanking possibility.
On the other hand, it is up to you to redo the code. and to check the code well before putting it in public, on google you never know!

Happy to pay for someone to code the script I need if that's possible?
 

Kurumi

New Member
Jul 28, 2015
13
6
I think there will be enough tutorial on google to find what you wish from a departure such as on github!


Après avec un filtre chercher en javascript pur.

After with a filter search in pure javascript.
I just came to try to help

Would be a shame to lose money, while you can find as much free source
If you are looking for a developer not too expensive to help you,
Maybe Fiverr would be helpful then
 
Last edited:

Users who are viewing this thread

Top