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

Load images from array, load only 2-3 images at startup (deferred or lazy load)? #183

Open
napishu opened this issue Nov 9, 2014 · 0 comments

Comments

@napishu
Copy link

napishu commented Nov 9, 2014

Hello!

I have Smooth-Div-Scroll in my header. High resolution pictures and a lot of them (> 20). And their number is growing. First problem that when we have a lot of images - your script is waiting for loading images and then show slider. It would be good to show the loader and then show our slider (I did it) , but this does not solve the main problem, only cosmetics for users.

I want not immediately load all the images and do not load the user's network. And for example, for devices with small screens Smooth-Div-Scroll is not shown, loading all html markup with images is not correct here! So first wee need some deferred function to load our images. I think it is very important with such scripts because it is not a simple slider, and it's great for more number of images and the sizes.

We know height and width of images.

Questions.

  1. Does it possible fetch images from javascript inline array (not from html dom img tags)?

For example

array = [
        {
            link: "http://google.com",
            image :"http://localhost/upload/image01.jpg",
                        width: "900",
                       height: "200"
        },
        {
            link: "http://google.com",
            image :"http://localhost/upload/image02.jpg",
                        width: "1000",
                       height: "200"
        }
 ]

  1. Deferred loading images? For example, on Smooth-Div-Scroll start load only 2 images, when scroll going to 2nd image (when 1nd image has reached its half scroll) - load next 2 images (3 & 4) in background etc... We can assume the total images width from javascript array If your plugin needs this counting.

I think you understand what I mean.

Thank you

@napishu napishu changed the title Load images from json, load only 2-3 images at startup (deferred)? Load images from array, load only 2-3 images at startup (deferred)? Nov 9, 2014
@napishu napishu changed the title Load images from array, load only 2-3 images at startup (deferred)? Load images from array, load only 2-3 images at startup (deferred or lazy load)? Nov 9, 2014
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

1 participant