logo
down
shadow

JQuery Hide/Show one, not all


JQuery Hide/Show one, not all

Content Index :

JQuery Hide/Show one, not all
Tag : javascript , By : Goeran
Date : November 24 2020, 09:00 AM

Hope this helps Your problem is that the p tag is not inside the h2 tag. You can either do:
$(this).siblings("p").removeClass("hidden");
$(this).parent().find("p").removeClass("hidden");

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

JQUERY - how Two elements - IMG - DIV when hover over IMG show/hide the DIV - added with hover hide/show on img allready


Tag : jquery , By : Daljit Dhadwal
Date : March 29 2020, 07:55 AM
With these it helps This is probably not the most elegant way to select the target div, but it should work:
$(".ExcommKnap").mouseover(function () { $(this).stop().fadeTo('fast', 0.5, function(){
      $(this).parent().prev('div').children().eq(0).show();
    }) 
});
 $(".ExcommKnap").mouseout(function () { $(this).stop().fadeTo('fast', 1.0, function(){
       $(this).parent().prev('div').children().eq(0).hide();
}) });

JQuery show hide with unordered list: need to add dynamic text / hide function


Tag : javascript , By : ffmmjj
Date : March 29 2020, 07:55 AM
wish helps you Here jquery toggle() function comes in handy - you can attach to event handlers that will be called every other time element is clicked. Use text() to change text of the link (which should't be a link if you don't plan a fallback - use span instead)
Updated fiddle.

Hide/Show Table with Jquery - Option to hide/show individual table or show/hide all table


Tag : jquery , By : Alpinfish
Date : March 29 2020, 07:55 AM
I wish this help you You can use the toggle() and next() mechanism.
I added here some CSS and a class show-table and tableLink to make it much simpler
$(document).ready(function(){
  $(".btn_hide").click(function(){
    $("table").hide();
    $("table").prev('p').removeClass('show-table');
  });
  $(".btn_show").click(function(){
    $("table").show();
    $("table").prev('p').addClass('show-table');
  });
  
  $(document).on('click','.tableLink',function(){
      $(this).parents('p').next().toggle();
      $(this).parents('p').toggleClass('show-table');
  });
});
table {
  border-collapse: collapse;
  width: 100%;
  display:none;
}

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

i.fa.fa-chevron-down {
  display:none
}

.show-table i.fa.fa-chevron-down {
  display:inline-block
}
.show-table i.fa.fa-chevron-right {
  display:none
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<button class="btn_hide">Hide All</button>
<button class="btn_show">Show All</button>


<p>
  <a class="tableLink">
    <i class="fa fa-chevron-right"></i>
    <i class="fa fa-chevron-down"></i>
  </a>
  <a href="#" class="tableLink"> Link to external page</a>
</p>

<table class="data_table">
  <tr>
    <th>tableheader</th>
    <th>tableheader</th>
    <th>tableheader</th>
  </tr>
  <tr>
    <td>tabledata</td>
    <td>tabledata</td>
    <td>tabledata</td>
  </tr>
  <tr>
    <td>tabledata</td>
    <td>tabledatag</td>
    <td>tabledata</td>
  </tr>
</table>

<p>
  <a class="tableLink">
    <i class="fa fa-chevron-right"></i>
    <i class="fa fa-chevron-down"></i>
  </a>
  <a href="#" class="tableLink"> Link to external page</a>
</p>

<table class="data_table hide-table">
  <tr>
    <th>tableheader</th>
    <th>tableheader</th>
    <th>tableheader</th>
  </tr>
  <tr>
    <td>tabledata</td>
    <td>tabledata</td>
    <td>tabledata</td>
  </tr>
  <tr>
    <td>tabledata</td>
    <td>tabledatag</td>
    <td>tabledata</td>
  </tr>
</table>
<p>
  <a class="tableLink">
    <i class="fa fa-chevron-right"></i>
    <i class="fa fa-chevron-down"></i>
  </a>
  <a href="#" class="tableLink"> Link to external page</a>
</p>

<table class="data_table hide-table">
  <tr>
    <th>tableheader</th>
    <th>tableheader</th>
    <th>tableheader</th>
  </tr>
  <tr>
    <td>tabledata</td>
    <td>tabledata</td>
    <td>tabledata</td>
  </tr>
  <tr>
    <td>tabledata</td>
    <td>tabledatag</td>
    <td>tabledata</td>
  </tr>
</table>

jQuery show/hide: How do you reset the value of a form element that is inside a show/hide div?


Tag : jquery , By : bjorngylling
Date : March 29 2020, 07:55 AM

Tag : jquery , By : Jeskl
Date : March 29 2020, 07:55 AM
Related Posts Related QUESTIONS :
  • Axios function not returning any values with js
  • How to use firestore TIMESTAMP to create time-stamp in JavaScript
  • Instantiate subclass without constructing
  • Outputing a created object in javascript to a server side JSON file
  • Transition the numeric labels in a bar chart
  • createBottomTabNavigator: hide just one tab from the tabBar
  • iife vs simple statement behavior with document.title
  • showDialogPopup Refresh Page after Click
  • Child component does not set the initial value passed from the parent: ReactJS
  • Nodejs javascript added to button not responding
  • Trying to define a promise.all
  • Python GEE to extract featurecollection timeseries from Landsat imageries
  • How to write negative binary number?
  • Unable to set property of individual object
  • Why Named Function Expression itself cannot assign Name to another Value?
  • How to reset scroll position on single page pagination
  • How to scroll to bottom of page, when a new message is sent - Socket.io
  • How to reconstruct audio blob from a base64 encoded String?
  • How to calculate numbers within an array of objects
  • Using JavaScript to change CSS properties of SVG circles for all circles that was not clicked
  • Is there value in propTypeing repeat required properties at every level of nested components?
  • Call function if variable does not exist in a filter
  • localStorage value doesn't get updated automatically
  • React not updating state with setState correctly inside promises
  • Direct native JavaScript or jQuery method to get containing block of an element
  • Dynamic JSON object to Html Table
  • How to send Id and file to same controller?
  • How to Make a jQuery Table Cell(td) clickable to Run a Function?
  • Prevent the duplicate function onchange event jQuery
  • Reactjs Input Upload doesn't return local URL
  • An unexpected 'StartObject' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected
  • How to filter a JSON Array, with an eventListener input value at keyup
  • How to separate the different properties of filter in css?
  • Why dont work change event of bootstrap input spinner?
  • How to hide overflow text content in react
  • Is there another way to write line 6
  • Cypress - how to find by text content?
  • How to setstate for the dynamic checkboxes in a loop in react?
  • Is display:none safe?
  • How to create a form to change part of a href url of a button?
  • Put many function inside function in Javascript
  • how to exit from loop after a ajax call
  • Do Angular Reactive Form Validator.min/max check Perform Type Conversions before checking the value?
  • How to Replace Text Within Script Tags Using JQuery
  • add variable to object if not undefined using short-hand
  • How can I effectively curve my items inside a list?
  • Add new record Keyboard Shortcut on Kendo Grid Mvc
  • Time and Date running on page
  • Looping through page links puppeteer doesn't return values from the newly loaded page
  • Problem with Navigator.geoLocation.getCurrentPosition not working
  • Trying to change the id of an element with Javascript
  • Embedded Schema Inserting Blank in Meteor using Collection2
  • avoid useEffect to render at first load?
  • Why is this CSS transition only working correctly on the some clicks? How to solve it?
  • Interpolated values does not reflect the latest values in an Angular app
  • Javascript classes define attribute in constructor or outside the class
  • How to block scroll event passing through to iframe until iframe is active?
  • What is the purpose of "constructor" method in javascript?
  • Stencil JS not working with non-default imports
  • Are frameworks misleadingly named for marketing purposes?
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com