Conceal Reveal Secret Script

Can you help me with a question regarding the spoiler on this specific page? Here is the link:

When I click on Windows, a table appears. However, when I click on Linux, the content of Windows disappears. I am looking to create a spoiler like this, but where the content of one spoiler does not disappear when another spoiler is pressed.

What specific changes should I make in the html source code below?

<div class="dokuwiki">
        <div class="right_page">
<div class="entry-content">
<script type="text/javascript" src="./JDownloader.org - Official Homepage_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($(this).find(".details").is(":visible"))
 {
   $(this).find(".details").not(":hidden").hide("slow");
   return true;
 }
 else
 {
   $(".OS").not(this).each(function(i) {
     $(this).find(".details").hide("slow");
   });
   $(this).find(".details").show("slow");
   return false;
 }
 });
 });
 </script>     
 <style type="text/css">
 <!--
.details {
display: none;
clear: both;
padding: 2px;
}
.nonjs{
    cursor:pointer;
}
img {
border: 0px;
}
-->
</style>

Answer №1

$(".OS").not(this).each(function(i) {
    $(this).find(".details").hide("slow");
});

This section is responsible for identifying and concealing all elements that do NOT match the current (clicked) one.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Client-side filtering of jqGrid with multiple conditions

I am faced with a challenge in filtering records in a jqGrid based on multiple conditions. For example, if there are columns for Name, Age, and City, and I need to filter the grid using the following condition: Name = "Mark" and Age = 25 and City = &apos ...

Troubleshooting: jQuery AJAX .done() function failing to execute

Currently, I have a piece of code that is being utilized to dynamically load HTML into a CodeIgniter view: $.ajax({ type:"POST", url: "Ajax/getHtml", data: { u : conten ...

Verifying if a particular track is currently playing in the HowlerJS playlist

I am currently experimenting with a HowlerJS playlist code and would like to create a button that can detect if a specific song in the playlist is playing. When this button is clicked, I want it to hide a certain line of text. However, my knowledge on this ...

There seems to be an issue with the visibility of the b-button within the b-table component in

I'm new to Vue Js and I'm having trouble with my b-button not displaying in my table. I can't figure out why. Below is my HTML code: <div id="listlocales"> <div class="overflow-auto"> ...

Leveraging v-for within a component that incorporates the <slot/> element to generate a versatile and interactive Tab menu

Currently, I am in the process of developing a dynamic tab menu using Vue 3 and slots. Successfully implementing tabs, I have created BaseTabsWrapper and BaseTab components. The challenge lies in using v-for with the BaseTab component inside a BaseTabsWrap ...

Utilizing JQuery Ajax to dynamically replace elements using JQuery functions

My issue is as follows... I am using AJAX and jQuery to populate a form. When the user makes a selection from a dropdown menu, AJAX retrieves data based on the choice and populates the form with this data. Sometimes, new elements are created when the AJA ...

Is it possible to update a MobX state when a message is received from Firebase in the background?

I've set up Firebase in my project like this: import { initializeApp } from 'firebase/app'; import { getMessaging, getToken, onMessage, isSupported } from 'firebase/messaging'; import store from './flag'; ...

The console is showing the Ajax Get request being logged, but for some reason it is not displaying on the

Could someone please explain why this response isn't displaying on the page? $.ajaxPrefilter( function (options) { if (options.crossDomain && jQuery.support.cors) { var http = (window.location.protocol === 'http:' ? &apos ...

Hide <a> by setting its display property to none

Below is the HTML code: <td> <a class="link" href="#"> <span class="download">Link</span> </a> <a class="link" href="#"> <span class="csvdownload">Link 2</span> </a> </td> I am lo ...

What makes fastify-plugin better than simply calling a regular function?

I recently came across a detailed explanation of how fastify-plugin operates and its functionality. Despite understanding the concept, I am left with a lingering question; what sets it apart from a standard function call without using the .register() metho ...

Tips on displaying a div for a brief moment and then concealing it

Is it possible to create a div that will disappear after 10 seconds of the page loading using PHP or JavaScript? Here is an example of the code: <html> <head></head> <body> <div class="LOADING" id="LOADING" name="LOADING">&l ...

Is it possible that the use of excessive React.Fragment could impact performance negatively?

After a recent review of our company's code, I discovered that the performance is not up to par. One common pattern I noticed in the code is something like this: condition ? <SomeComponent /> : <></> I see that Fragments are being u ...

Tips for designing a pre-selection process

I've been considering the idea of implementing a temporary screen that allows users to choose between different options before proceeding to a specific page. For instance, on the contact page, users would be prompted with a question like "Are you loo ...

Executing an automated process of adding items to the shopping cart using Python without the need to have a

Does anyone know of a way to automate the add-to-cart process using Python without the need for an open browser window? I've experimented with modules like mechanize, but they lack the ability to directly interact with web elements. Currently, I&apo ...

Does the server transmit HTML page content rather than the information you need?

My React application is connected to a backend built with Node.js. However, when I try to fetch data in my React component, the server sends back an HTML page instead of the expected data, displaying raw HTML on the screen. Backend (server.js): app.route ...

What could be causing these transformed canvases to not display fully in Chrome at specific resolutions?

fiddle: https://jsfiddle.net/f8hscrd0/66/ html: <body> <div id="canvas_div"> </div> </body> js: let colors = [ ['#000','#00F','#0F0'], ['#0FF','#F00','#F0F&a ...

Keep the link underlined until a different button is pressed

I need help with a webpage that displays a list of partners organized by categories. When clicking on sidebar categories, the link remains underlined. However, if you click anywhere else on the page, the link becomes inactive. CSS: button:hover { t ...

Enhanced functionality in MUI TablePagination now allows users to easily select their desired page

I've implemented MUI TablePagination to enable pagination in my table. The code is performing well, offering most of the features I need: Users can choose between displaying 5, 10, or 20 entries per page using a dropdown. The number of pages displaye ...

The user's input is not being bound properly when using $scope.$watch

Just started my Angular journey and I've been stuck for the past couple of days trying to figure out how to bind data from a new search using a service. Previously, I had the search functionality working with the code below before transitioning to a s ...

Filter out the selection choice that begins with 'aa' in the drop-down menu

Here is a select field with various options: <select id="sel"> <option value="1">aadkdo</option> <option value="2">sdsdf</option> <option value="3">aasdfsddkdo</option> <option value="4"> ...