Skip to content

Instantly share code, notes, and snippets.

@bjornpatje
Last active September 6, 2024 09:08
Show Gist options
  • Select an option

  • Save bjornpatje/bb2f591d31017b3fdb6d93bb71a3544e to your computer and use it in GitHub Desktop.

Select an option

Save bjornpatje/bb2f591d31017b3fdb6d93bb71a3544e to your computer and use it in GitHub Desktop.
Change image on hover Flatsome
.changeable .bg{
transition: all 0.2s ease-in-out;
transition-delay: 150ms;
}
<script>
jQuery('.change-beach').hover(function() {
jQuery('.changeable .bg').css("content", "url(https://your-url/wp-content/folder/etc.jpg)");
});
jQuery('.change-nature').hover(function() {
jQuery('.changeable .bg').css("content", "url(https://your-url/wp-content/folder/etc2.jpg)");
});
jQuery('.change-culture').hover(function() {
jQuery('.changeable .bg').css("content", "url(https://your-url/wp-content/folder/etc3.jpg)");
});
jQuery('.change-active').hover(function() {
jQuery('.changeable .bg').css("content", "url(https://your-url/wp-content/folder/etc4.jpg)");
});
jQuery('.change-wellness').hover(function() {
jQuery('.changeable .bg').css("content", "url(https://your-url/wp-content/folder/etc5.jpg)");
});
jQuery('.change-restaurants').hover(function() {
jQuery('.changeable .bg').css("content", "url(https://your-url/wp-content/folder/etc6.jpg)");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment