I have a background image set the following way:
#collection-5777203c893fc094ec1de004{
background-image: url(https://static1.squarespace.com/static/57771b9e15d5dbc2f8fc084d/57771c55e3df28c63c9e687f/57771ca7440243196bc6801b/1467423990309/Gator.jpg?format=1500w);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
I have a link that I would like to trigger a background image change on hover and I would like it to return to the original image when not hovering over the link.
I have gotten the background image to change using this jquery:
<script>
jQuery('#block-5777203c893fc094ec1de005').hover(function()
{
jQuery('#collection-5777203c893fc094ec1de004').css("background-image", "url(https://static1.squarespace.com/static/57771b9e15d5dbc2f8fc084d/57771c55e3df28c63c9e687f/57771d441b631b48a1362df6/1467424076131/patagoniawater.jpg?format=750w)");
});
</script>
Can someone show me the code to return the image back to its original background image when not hovering over the link?
The image also changes in a slightly glitchy way. I'm not sure if there is something I can do to make the change smoother.
Thanks in advance.