Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to ignore horizontal, load invisible and force load . #45

Closed
AbhishekNafdey opened this issue Feb 26, 2015 · 1 comment
Closed

Comments

@AbhishekNafdey
Copy link

Hi,

I am using this plugin and its working great for me . Thanks ! .

A few things that i found useful and missing are -
1 - When a container has horizontal scroll , images do not get loaded till we scroll the page as horizontal scroll is on the div. I understand that this can be achieved using the container option but if i need to use a single instance of this plugin it becomes hard. Instead we can have a option to skip horizontal cheek .What I did in the older version was as follows -
return (
// inside horizontal view
(options.skipHorizontal || rect.left >= 0
&& rect.right <= winWidth + options.offset )
&&
(
// from top to bottom
rect.top >= 0 ……

2 – For issues with hidden images like in tabs, I see you have added a force variable in load. This makes the developer call it when every time its needed. Instead we could add this too as an option to load hidden images.
function loadImage(ele){
// if element is visible
if(options.loadInvisible || (ele.offsetWidth > 0 && ele.offsetHeight > 0)) {
…….

3 – A force parameted in load can be very useful too. In situation when I need to force load an image o matter in view port or not .Kind of preloading in carousels .For this I used the force variable as following.
Blazy.prototype.load = function(element ,force){
if(force || !isElementLoaded(element)){

It could be great if you add these options as they can give more flexibility depending on different scenarios to lot of us.

@dinbror
Copy link
Owner

dinbror commented Oct 30, 2015

Fixed 2/3 of your requests in v. 1.5.0. Thanks

@dinbror dinbror closed this as completed Oct 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants