How can I interchange the li image when hover using .load, My code only show image1.
What I want to achieve is, whenever I hover to image2; image2 will appear in place holder, hover to image3; image 3 will appear.......
$(document).ready(function() {
$(".result").mouseover(function() {
$(".cardPlaceholder").load('/image1.html .CLASS ELEMENT').show();
$(".cardholder").hide();
}).mouseout(function() {
$(".cardPlaceholder>img").attr('src', 'placeholder image.jpg').show();
})
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<ul class="cardList">
<li><span class="result">image 1</span>
<img class="imgAlt" src="image1.jpg" alt="image 1" />
</li>
<li><span class="result">image 2</span>
<img class="imgAlt" src="image12.jpg" alt="Image 2" />
</li>
<li><span class="result">image 3</span>
<img class="imgAlt" src="image3.jpg" alt="Image 3" />
</li>
</ul>
<div class="cardPlaceholder">
<img class="cardholder" src="placeholder image.jpg" alt="">
</div>