Solved

jQuery loop and target a specific <li>

Posted on 2011-02-14
3
389 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
  • 2
3 Comments
 
LVL 40

Expert Comment

by:gurvinder372
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:
gurvinder372 earned 500 total points
ID: 34903732
sure i can plug the same in your carousel code you are using. Please share the same
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

895 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