jQuery hover slide up but show first list item always
Date : March 29 2020, 07:55 AM
|
jquery iterate list images with timer and hover
Date : March 29 2020, 07:55 AM
help you fix your problem I have a list where li's have img's. The images are thumbnails and there is another div where the large version of the thumbs should be iterated through. Also when the user wands over the thumbnail the large image iteration should halt and display what is hovered over. , I made this for you, take a look... Live Demo:
|
Select List closes on hover of Option inside jQuery Show/Hide Div on Hover
Date : March 29 2020, 07:55 AM
will help you I have set a div through jQuery to show and hide on hover of an item. Within the div I have dropdowns, but when I click on the Select List and hover on the Options List, the Select Menu closes instantly. , use mouseenter and mouseleave instead of mouseover and mouseout $(".tiptext").mouseenter(function() {
$(this).children(".description").show();
}).mouseleave(function() {
$(this).children(".description").hide();
});
|
jQuery hover/hide/show - not all the text will disappear correctly when mousing over multiple images
Date : March 29 2020, 07:55 AM
it helps some times It is because of the queuing nature of animation commands, in your case you need to force jQuery to complete all the previously queued animation before showing/hiding an element. You can use .stop() to do this. Also your solution looks quite complecated, I've made some dom changes also to make it simple <table>
<tr>
<td>
<img src="http://placehold.it/150x150" id="image1" alt="description" width="150px" class="content-img" data-target="#content1" />
</td>
<td>
<img src="http://placehold.it/150x150" id="image2" alt="description" width="150px" class="content-img" data-target="#content2" />
</td>
<td>
<img src="http://placehold.it/150x150" id="image3" alt="description" width="150px" class="content-img" data-target="#content3" />
</td>
</tr>
<tr>
<td colspan="3" style="height:100px">
<div id="default">
<h1>default</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div id="content1">
<h1>content 1</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div id="content2">
<h1>content 2</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div id="content3">
<h1>content 3</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</td>
</tr>
</table>
//initial
var timer = 200;
jQuery(function ($) {
var inside = false;
$("#content1, #content2, #content3").hide();
$(".content-img").hover(function () {
inside = true;
var $target = $($(this).data('target'));
$("#default").stop(true, true).hide(timer, function () {
if (inside) {
$target.stop(true, true).show(timer);
}
});
}, function () {
inside = false;
$($(this).data('target')).stop(true, true).hide(timer, function () {
if (!inside) {
$("#default").stop(true, true).show(timer);
}
});
});
});
|
How to show different images using .hover() jQuery
Date : March 29 2020, 07:55 AM
seems to work fine You could associate the span with a particular image via a data attribute and id. $(".displayImage").hover(function(){
// $(this).attr('data-img') == 'azotea' or 'nivel8'
// so we end up with $('#azotea').show(), for example.
$('#' + $(this).attr('data-img')).show();
}, function () {
$('#' + $(this).attr('data-img')).hide();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tbody>
<tr>
<td style="width: 20%;" class="text-center">
<span class="displayImage" data-img='azotea'>Azotea </span>
<span class="displayImage" data-img='nivel8'>Nivel 8 </span>
</td>
</tr>
</tbody>
</table>
<div class="col-lg-5 text-left">
<img class="displayed" src="images/azotea-n9.jpg" alt="azotea" id="azotea">
<img class="displayed" src="images/test2.jpg" alt="nivel 8" id="nivel8">
</div>
|