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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:24:59+00:00 2026-06-06T08:24:59+00:00

ok, yet another jquery selector nightmare for me ! I’ve read about 20 questions

  • 0

ok, yet another jquery selector nightmare for me ! I’ve read about 20 questions with similar topic, but I couldn’t find one with my problem … sorry if it did exist ( probably does somewhere ) its seems pointlessly easy but somehow I can’t get it to work.

I have a list of img, and when you click on one, I get hold of its 2nd class. Once I have this second class, I want to hide or show other element who have that class

heres some code to clarify :

<ul id="thumbail_list">
   <li class="image fantome"><img src="images/fantome.png"/></li>
<ul>

let’s say I click on my fantome image I want that somewhere else a paragraph with class texte and fantome which is hidden by default become visible.

$('#thumbail_list li').click(function() {

    var Chosenclass = $(this).attr('class').split(' ')[1];  
    var texte = '.text .' + Chosenclass ;
    var image = '.image .' + Chosenclass ;

    $('.image').fadeIn('slow', function(){
        $(image).fadeOut('slow', function(){
            $(texte).fadeIn('slow');            
        });

    });
}

but I can’t get this to work, console doesn’t show me any error, and I,ve put alert everywhere and it always show me what I want … but the invisible text won’t show.

  • 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-06T08:25:01+00:00Added an answer on June 6, 2026 at 8:25 am

    If the text has both class .text and .fantome, you must chain the selectors:

    .text.fantome <- without space
    

    So get rid of the space:

    var texte = '.text.' + Chosenclass ;
                    ^^^^
    

    With the space you would select an object of class ChosenClass who is child (or descendant) of an element of class .text.

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

Sidebar

Related Questions

Yet another PHP question. I've got two arrays: one string-based and the other numeric.
I'm trying to produce yet another lightbox as much needed HTML/CSS/Javascript practice, but I've
I'm having yet another wtf moment with jQuery. I am importing the following files
[I did see the similar problems solved with AJAX/jQuery, so please read on]. I
I come with yet another question on jQuery : So i have this code
Yet another data structure doubt. I will get straight to it. This is what
Yet another newbie with ASP.NET MVC! All I intend to do is for a
I've just added yet another 3rd-party component to my .net project that contains a
I was handling yet another KeyDown event in a user control when I wondered
I have yet another issue which the answer is eluding me. I wish to

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.