jQuery loop and target a specific <li>

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>.

Who is Participating?
Gurvinder Pal SinghConnect With a Mentor Commented:
sure i can plug the same in your carousel code you are using. Please share the same
Gurvinder Pal SinghCommented:
rather than 3, make it n+3.
where n starts from 0, and increments everytime you scroll.
gvilla23Author Commented:
Can you elaborate with some code, please?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.