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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:24:33+00:00 2026-06-09T15:24:33+00:00

To change selector so it only show/hides when i click the image i put

  • 0

To change selector so it only show/hides when i click the image i put spoiler/ popdown menu directly after .OS image. Right now the popdown is a child of the .OS container, so clicks on it are passed to the .OS click handler.

But the code isn’t perfect because when i click the 1st MAC both spoilers are opened.

But I want that spoilers are opened one at a time

But the main problem is that I can’t fix the javascript code properly inside these types of spoilers (dokuwiki class) inside <td> tags:

This is the javascript code I use :

<div class="dokuwiki">
    <div class="right_page">
        <div class="entry-content">
            <script type="text/javascript" src="./zzzz_files/jquery.js"></script>
            <script type="text/javascript">                                         
                $(document).ready(function(){
                    $(".nonjs").removeAttr( "href"); //href is needed for users without JS
                    $('.OS').click(function(){
                        if($(".details").is(":visible"))
                        {
                            $(".details").not(":hidden").hide("slow");
                            return true;
                        }
                        else
                        {
                            $(".OS").not(this).each(function(i) {
                                $(".details").hide("slow");
                            });
                            $(".details").show("slow");
                            return false;
                        }
                    });
                });  
            </script>     
            <style type="text/css">
                <!--
                .details {
                    display: none;
                    clear: both;
                    padding: 2px;
                }
                .nonjs{
                    cursor:pointer;
                }
                img {
                    border: 0px;
                }
                -->
            </style>

I thought about doing a video to better explain the problem and provide the local version of files for testing code:

Thanks in advance

  • 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-09T15:24:35+00:00Added an answer on June 9, 2026 at 3:24 pm

    This code works:

     $(document).ready(function(){
     $(".nonjs").removeAttr( "href"); 
    //href is needed for users without JS
    
     $('.OS').click(function(e){
               if(!$(e.target).parents('.details').length){
                            if($(this).find('.details').is(":visible"))
                            {
                                $(this).find('.details').not(":hidden").hide("slow");
                                return true;
                            }
                            else
                            {
    
                                $(this).find('.details').show("slow");
                                return false;
                            }
              }
    });
     }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the following selector to change image of image button, when I click
I change some methods from $(selector).live('click', function(){}); to $(selector).on('click', function(){}); . At first it
How do I change this selector to only call my function if the target
Change all links that have an image in it to: javascript(alert(thehref)); eg. <a href=/galleries/anna-leah-111827/image01.html><img
To change Proxy server I have to go to IE->Internet Options->LAN Settings and click
Is there any option, or special selector to change the style for a pressed
EDIT: I stuck in a single call to manually retain the array right after
I'm trying to change a spoiler but i have problem with javascript code This
I want to change the style of visible elements using CSS only. Is there
change() function works and detects changes on form elements, but is there a way

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.