using jQuery’s .next function I want to show next 2 items. By default it selects only just next item.
I need control, like sometimes I need next 2, sometime next 3
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
.nextAll()and a:lt()selector, for example:Try it out here. If you need it to be programmatic (instead of string concatenation) and change it easily, use
.slice()instead:This method allows you to pass as a parameter the number you need a bit easier. You can test it here.