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

  • Home
  • SEARCH
  • 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 7190727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:34:39+00:00 2026-05-28T19:34:39+00:00

I have the following html and I want to use jQuery to toggle the

  • 0

I have the following html and I want to use jQuery to toggle the display/visibility of the child divs in the product-preview-wrapper div. This is to be done by selecting which one to show by selecting OPTION_one, OPTION_two or OPTION_three from the product-image-wrapper div. Also OPTION_one needs to be selected be default at run time (hiding STUFF_two and STUFF_three).

<div class="product-preview-wrapper">
  <div id="wrap">STUFF_one</div>
  <div id="wrap">STUFF_two</div>
  <div id="wrap">STUFF_three</div>
</div>

<div class="product-image-wrapper">
  <div class="product-img-thumb-small">OPTION_one</div>
  <div class="product-img-thumb-small">OPTION_two</div>
  <div class="product-img-thumb-small">OPTION_three</div>
</div>

I know there’s something with indexing but I couldn’t get my head around it. I also need the function to allow for different amounts of content… there wont always be 3 child divs to toggle.

I played with toggle,hide & show and css(‘display’, ‘none’) and fell a bit short with my experience.

I haven’t posted my try code here as it didn’t work and is a total mess anyway.

Any advice/direction with this would be much appreciated.

C

  • 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-05-28T19:34:41+00:00Added an answer on May 28, 2026 at 7:34 pm

    Don’t use the same id for multiple elements. id is unique!

    Once you fix that, make use of .index():

    $('.product-image-wrapper .product-img-thumb-small').click(function() {
      $('.product-preview-wrapper')
       .children()
       .eq($(this).index())
       .show()
       .siblings()
       .hide();
    });
    
    // To load the first one
    $('.product-image-wrapper .product-img-thumb-small').eq(0).click();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML: <span id=UnitCost5>$3,079.95 to $3,479.95</span> And i want to use
I have following HTML: <div class=olympics style=display: block; position: absolute; left: 250px; top: px;>
I have the following HTML: <div id=mydiv> <div class=myclass></div> </div> I want to be
i have the following html , and i want to hide all lsHeader which
I have the following HTML: <input type=email id=email> I want to type text into
I have the following html content: <p>My name is <a href=way2project>way2project</a></p> Now I want
I have the following tag with a Html.TextBoxFor expression and I want the contents
I have the following html : <div class=mainmenu> <ul class=blue> <li class=><a href=tst/ id=a1_up><span
How can I use JQuery to do the following with the below HTML: I
I have the following HTML structure <div id=test-1-yay></div> ... bunch of code ... <div

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.