Last active
March 25, 2018 13:01
-
-
Save srobbin/1978737 to your computer and use it in GitHub Desktop.
Backstretch Demo: Button Click
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* You can easily attach Backstretch to jQuery events, like click | |
* | |
* Click the buttons above to see the background image change | |
*/ | |
$("#outside").click(function(e) { | |
e.preventDefault(); | |
$.backstretch('images/outside.jpg'); | |
}); | |
$("#cheers").click(function(e) { | |
e.preventDefault(); | |
$.backstretch('images/cheers.jpg'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi guys,
I would like to know if it would be possible to use this code with "Hover" instead of "Click" please. I am novice to jquery.
Thank you very much for ur help !