Solved

scrollup

Posted on 2014-03-03
4
136 Views
Last Modified: 2014-03-07
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.
0
Comment
Question by:praveen1981
  • 2
  • 2
4 Comments
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
Comment Utility
A code sample would help please.  It may just be something simple but hard to know without seeing the code.
0
 

Author Comment

by:praveen1981
Comment Utility
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.
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
Comment Utility
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
0
 

Author Closing Comment

by:praveen1981
Comment Utility
Many thanks
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now