Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

identify div

Posted on 2014-02-27
3
Medium Priority
?
240 Views
Last Modified: 2014-03-03
Hi

I have ten images each loading dynamically and i have class responsiveimages for each div
now when the user is scrolling up the last image , i want to load ten more images , now how to identify that user is scrolling last image, this is for mobile appliction and i am using asp.net mvc, with html5 and css  and i am not using jquery mobile.

please suggest.
0
Comment
Question by:praveen1981
  • 2
3 Comments
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 1500 total points
ID: 39894533
If you are at least using jquery, you can use last child https://api.jquery.com/last-child-selector/ 
$( "div:last-child" ) 

Open in new window

or in js https://developer.mozilla.org/en-US/docs/Web/API/Node.lastChild 
var tr = document.getElementById("row1");
var corner_td = tr.lastChild;

Open in new window


Since you are generating the div's dynamically, you could just as easy add a class to the div like, "last_image".   Then create an event when that is reached to make an ajax call.
0
 

Author Closing Comment

by:praveen1981
ID: 39899628
Thanks
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39899914
praveen1981, I am glad this worked for you.   You awarded this question a "B" grade. What would have made the answer an "A".  Please note that the grading on EE is not like a school grade.  The default grade should be an "A" http://support.experts-exchange.com/customer/portal/articles/481419-what-grade-should-i-award-?b_id=44

A B grade means the solution given lacked some information or required you to do a good amount of extra work to resolve the problem. When closing the question, the asker should explain why a B grade was awarded.

Will you please let me know what this question lacked?
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

782 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