This example uses an Image thumbnail button to select panel content within a column and change page background colour on each selection
4/5 - (1 vote)
This example uses an Image thumbnail button to select panel content within a column and change page background colour on each selection
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
Atribute
selector{
cursor: pointer;
transition: 0.5s;
}
selector:hover{
transform: translateY(-12px)
}
------------------------
data-jim|https://robedge.com/wp-content/uploads/2022/09/eastCardinal.jpg
data-color|#000000
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script type="text/javascript">
var $ = jQuery;
$(document).ready(function(){
$('[data-jim]').on('click', function(){
var jim = $(this).attr('data-jim')
var bColor = $(this).attr('data-color')
$('.flipcard img').attr('src', jim ).attr('srcset', '')
$(".flipcard-section").css("background-color", bColor);
})
})
</script>