Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8559029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:56:41+00:00 2026-06-11T15:56:41+00:00

I am trying to match two index values between slider big images and it’s

  • 0

I am trying to match two index values between slider big images and it’s thumbs. When one the thumbs clicked, i am getting index() value of it and try to match with another list to show that image.

Here is jsFiddle example.

jQuery:

var thumbs = $('ul.thumbHolder li');
var bigImg = $('ul.imgHolder li');

thumbs.click(function() {
    var target = $(this).index();
    bigImg.fadeOut(300);
    //problem here
    bigImg.index(target).fadeIn(300);
});​

Note: I can do this with id/class logic but need to solve it with this way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:56:43+00:00Added an answer on June 11, 2026 at 3:56 pm

    I’d go with something like this if I had to do it :

    var thumbs = $('ul.thumbHolder li');
    var bigImg = $('ul.imgHolder li');
    
    thumbs.click(function() {
        var target = $(this).index();
        bigImg.each(function(){
            if($(this).index() != target){
                $(this).fadeOut(300);
            }else{
                $(this).fadeIn(300);
            }
        });    
    });​
    

    Anyway, if you wanna keep the logic of your code, the problem is about the function index() on your last line, it returns the index of a jQuery object, but not the jQuery object of a given index.

    According to the jQuery API the complementary function of index() is get() but it only returns the DOM Element, hence you can call fadeIn() to it.

    What you need to do is to get the jQuery object through eq() method :

    var thumbs = $('ul.thumbHolder li');
    var bigImg = $('ul.imgHolder li');
    thumbs.click(function() {
        var target = $(this).index();
    
        bigImg.fadeOut(300);
    
        bigImg.eq(target).fadeIn(300);
    
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decide between two options to achieve a prefix match for names
I am trying to match two values in two arrays var months ['jan', 'feb',
I'm trying to craft two regular expressions that will match URIs. These URIs are
I'm trying to match a string against a pattern, but there's one thing I
I'm trying to use the range pattern [01-12] in regex to match two digit
I need to match two cases by one reg expression and do replacement 'long.file.name.jpg'
I am trying to match two contours with the matchShapes method but I always
I am trying to match two or more words in a string. The string
I'm trying to compare two values in the same table, and check if there
I need to match two very large Numpy arrays (one is 20000 rows, another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.