?
Solved

jQuery loop and target a specific <li>

Posted on 2011-02-14
3
Medium Priority
?
402 Views
Last Modified: 2012-05-11
So I have a list item with 10 items in it, I have them in a carousel.

The carousel has only 5 of the <li> viewable and in those I want to target the middle one, even when some some scrolls the carousel.

I can target the third one like this $("ul li:nth-child(3)"), but when I scroll the third <li> moves in the direction of the carousel, I need it fixed on the third viewable <li>.

Thanks,
0
Comment
Question by:gvilla23
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 34893833
rather than 3, make it n+3.
where n starts from 0, and increments everytime you scroll.
0
 

Author Comment

by:gvilla23
ID: 34893933
Can you elaborate with some code, please?
0
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 2000 total points
ID: 34903732
sure i can plug the same in your carousel code you are using. Please share the same
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

777 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