scrollup

praveen1981
praveen1981 used Ask the Experts™
on
Hi

I have three images , i am scrolled down till

last image , now if i try to scroll up the last

image , i am unable to scroll because the window

was already scrolled down.

now how do i scroll up the last image,once i scrolled

up the last image i want to load few more images

I cannot use click event as it is doing some other

operations on click event so,I used window.scroll , but it is helpless.

I am using asp.net mvc and jquery.

could you please suggest how to achieve this.

           Many thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
RobOwner (Aidellio)
Most Valuable Expert 2015

Commented:
A code sample would help please.  It may just be something simple but hard to know without seeing the code.

Author

Commented:
please find the code in below

$(window).scroll(function () {

                var lastdiv = $('.homepage-slider').last();
                lastdiv.attr('id', '100');
                $('#100').scrollTop(function () {

                 // call function to load images

                });
});

i am calling the function loadimages but it is not  firing after the last image.

i.e initially i have 3 images , after the last image if i scroll up , i want to load few more images but the scrolltop event is not working because the window is already scrolled down ,

please suggest how to achieve this.
Owner (Aidellio)
Most Valuable Expert 2015
Commented:
To be honest, that's what i thought you were referring to.  This is called "Lazy Loading" and don't go reinventing the wheel but use a plugin such as this one given you're using jquery. http://www.appelsiini.net/projects/lazyload

Author

Commented:
Many thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial