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 6165125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:06:43+00:00 2026-05-23T22:06:43+00:00

Im using jQuery to create button that will show Photos with absolute position. However,

  • 0

Im using jQuery to create button that will show Photos with absolute position. However, i tried to configure the code with this.

$('#thumbsets li').each(function (i) {
    i = i+1;
    $(this).addClass('ts'+i);
});

$('#web_overview details').each(function (i) {
    i = i+1;
    $(this).addClass('panels'+i).hide();
});

After that, i will create now the main button since i have all specified classes in each class.

$('#web_overview details').each(function (i) {
    i = i+1;
    $(this).addClass('panels'+i).hide(); //Hide all main photos

    // Create button command
    $('.ts'+i).bind({
        click: function() {
            $('.panels'+i).show(); //If clicked photos will show up

            //Fallback for the other photos
        }
    });
});

Now my issue here is, how can i load back again the previous photo if i click .ts1 since .panels2 stuck over the .panels1

Here’s my sample output:

.ts1 -> .panels1 | .ts2 -> .panels2 | .ts1 -> .panels1 (if i click again the .ts1 to load it back on the framebox .panels2 will remain at the top of .panels1.)

Thanks in advance if someone can give me idea on how to fix this.

  • 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-23T22:06:44+00:00Added an answer on May 23, 2026 at 10:06 pm
    $('.ts'+i).bind({
        click: function() {
            $('.panels').hide();   //####### Is this what you are missing?  ########
            $('.panels'+i).show(); //If clicked photos will show up
    
            //Fallback for the other photos
        }
    });
    

    You have to hide any visible .panels before opening a new one.


    But I think you are overcomplicating it… I used too once to assign classes to elements like you do. Why not try with something more simple?

    $('.details').hide(); // hide all details
    
    $('#thumbsets li').bind('click',function() {
        var tsLi = $(this).index(); // all elements in collection are indexed
        $('.details').stop().fadeTo(400,0).eq(tsLi).fadeTo(400,1);
    });
    

    That’s all!

    DEMO JSFiddle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create multilevel accordion Navigation using jQuery , I tried using this
I am using jquery to create a custom dropdown with the code below. I
I will be using jQuery's functionality to create portlet widgets for my web application
I am trying to create a jQuery click function that will close a div
I am using the jQuery BBQ: Back Button & Query Library plugin to create
I have a button that will create a new entry (row in a table)
I'm using a piece of JQuery to create the effect described at this website:
I'm trying to create a button that, when clicked will cycle ad nauseum through
I'm using jQuery to create a load of tabs for a web application. I've
I was using jQuery plugins to create a rounded corner for my <li> ,

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.