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
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
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
|
Date : March 29 2020, 07:55 AM
|